/* The frame: the ground, the logo, the shell, the menu, the help and retailer cards, the page's
   column and its head, the signed-out column, the legal links, the error pages' moment.
   The new look's frame (SKI-1278; docs/agents/portal-design.md, "The frame"): every value reads
   a variable of css/tokens.css; nothing moves. */

/* ── the ground ────────────────────────────────────────────
   The canvas with three soft clouds of rose, sky and butter, the characters' mids, each gone at
   70% of its radius and never stronger than 32% at its centre (System §7, "How strong"): rose at
   30%, butter at 26%, sky at 20%, placed as the drawings place them (portalSmallPages/failedWide).
   Behind the door and an error page seen signed out; never behind a work page. */
.ground {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-canvas);
  background-image:
    radial-gradient(
      ellipse 38% 46% at 14% 18% in oklab,
      color-mix(in oklab, var(--color-rose-mid) 30%, transparent) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 34% 44% at 88% 84% in oklab,
      color-mix(in oklab, var(--color-butter-mid) 26%, transparent) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 30% 40% at 92% 8% in oklab,
      color-mix(in oklab, var(--color-sky-mid) 20%, transparent) 0%,
      transparent 70%
    );
}

/* ── the logo ──────────────────────────────────────────────
   The website's Logo.css (views/logo.tsx): every measure a share of the word's size, as the
   drawings give them. 30 in the wide menu and at the door, 24 in the phone's top bar (under 900)
   and on the door's phone (under 600). It never moves. */
.logo {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  color: var(--color-ink);
  font-size: var(--text-logo-30);
  text-decoration: none;
  text-transform: none;
}
.logo:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.logo-word {
  display: flex;
  align-items: flex-end;
  height: 1em;
  font-family: var(--font-site);
  font-weight: var(--font-weight-black);
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: pre;
}
/* The i without its dot, a little room on each side; Nejma is its dot. */
.logo-i {
  position: relative;
  padding-inline: 0.07em;
}
/* Souki in place of the o; Ghayma after the k: each in a space of its own. */
.logo-o,
.logo-after {
  position: relative;
  flex-shrink: 0;
  height: 1em;
}
.logo-o {
  width: 0.73em;
}
.logo-after {
  width: 0.55em;
}
.logo img {
  position: absolute;
  max-width: none;
}
.logo-nejma {
  bottom: 0.68em;
  left: -0.153em;
  width: 0.72em;
  height: 0.72em;
}
.logo-souki {
  bottom: -0.076em;
  left: -0.105em;
  width: 0.94em;
  height: 0.94em;
}
.logo-ghayma {
  bottom: 0.007em;
  left: -0.13em;
  width: 0.86em;
  height: 0.86em;
}
@media (max-width: 900px) {
  .logo-menu {
    font-size: var(--text-logo-24);
  }
}
@media (max-width: 600px) {
  .logo-door {
    font-size: var(--text-logo-24);
  }
}

/* ── shell ─────────────────────────────────────────────────
   The menu, 248 wide on the canvas, stays in place while the window scrolls; the page sits on the
   canvas beside it, no panel around it (portal/homeWide). Under 900 the menu becomes two rows at
   the top: the logo and the shop, then the entries' icons (portal/homePhone). */
.shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  flex: none;
  width: 248px;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px 20px;
}
.sidebar .brand {
  flex: none;
  display: flex;
  padding: 0 12px;
}
/* The entries: pills 40 high, a line icon of 20 and a Label in ink 2; the page you are on, and the
   one under the pointer, on rose's soft in ink. */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--color-ink-2);
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-label);
  text-decoration: none;
  white-space: nowrap;
}
.nav a .ph {
  width: 20px;
  height: 20px;
}
@media (hover: hover) {
  .nav a:hover {
    background: var(--color-rose-soft);
    color: var(--color-ink);
  }
}
.nav a.on {
  background: var(--color-rose-soft);
  color: var(--color-ink);
}
.nav a:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}
/* The label keeps its width: « Performance » and its badge run a little past the pill's padding,
   as the drawings have them. */
.nav a .txt {
  flex: 1;
}
/* « Nouveau »: a badge in rose's tint, its words in rose's deep. */
.nav a .fresh {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: var(--color-rose-tint);
  color: var(--color-rose-deep);
  font-size: var(--text-badge);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-badge);
}
/* A count: an ink disc, its figure in paper. */
.nav a .count {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: var(--text-badge);
  font-weight: var(--font-weight-bold);
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sidebar .bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
/* help: a paper card with the thin edge, a line icon, a Label and a Small in ink 2 */
.help {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-16);
  background: var(--color-paper);
  color: var(--color-ink);
  text-decoration: none;
}
@media (hover: hover) {
  .help:hover {
    box-shadow: var(--shadow-lift);
  }
}
.help:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}
.helpicon {
  display: inline-flex;
  flex: none;
}
.helpicon .ph-duotone {
  width: 20px;
  height: 20px;
  color: var(--color-ink);
}
.helptxt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.helptxt b {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-label);
}
.helptxt span {
  color: var(--color-ink-2);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}
/* the retailer: its avatar on rose's tint, its name and domain, the round « … » */
.retailercard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.retailercard .avatar {
  position: relative;
  overflow: hidden;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--spacing-control-small);
  height: var(--spacing-control-small);
  border-radius: var(--radius-pill);
  background: var(--color-rose-tint);
  color: var(--color-rose-deep);
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-label);
}
/* The logo covers the initial; portal.js removes it when it fails to load. */
.retailercard .avatar .retailerlogo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-paper);
}
.retailercard > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.retailercard b,
.retailercard .tiny {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.retailercard b {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-label);
}
.retailercard .tiny {
  color: var(--color-muted);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}
.retailercard .signout {
  margin-left: auto;
  color: var(--color-muted);
  text-decoration: none;
}
.retailercard form {
  display: contents;
}
/* The « … » is drawn as its line alone, no fill and no edge, 8 after the words (portal/homeWide):
   a round button of 36 all the same, laid out as its icon, rose's soft under the pointer. */
.retailercard .menubtn {
  margin-inline: -11px -9px;
  border-color: transparent;
  background: transparent;
}
@media (hover: hover) {
  .retailercard .menubtn:hover {
    background: var(--color-rose-soft);
  }
}

/* ── the page ──────────────────────────────────────────────
   On the canvas, no panel: the column as the drawings pad it, 32 above, 16 at the menu's side and
   32 at the window's, 56 below. */
.main {
  flex: 1;
  min-width: 0;
}
.mainwrap {
  max-width: 1440px;
  padding: 32px 32px 56px 16px;
}
/* The page's head: its name a Heading, the line under it a Small in muted, the actions at its
   right. */
.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pagehead > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pagehead .sub {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}
.pagehead .sub .dot {
  flex: none;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-green-mid);
}

/* ── the retailer menu's foot: the conditions and the privacy notice ── */
.menu .menu-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-edge);
  color: var(--color-muted);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}
.menu .menu-legal a[role="menuitem"] {
  display: inline-block;
  width: auto;
  padding: 4px 6px;
  color: inherit;
  font-size: var(--text-small);
}
.menu .menu-legal a[role="menuitem"]:hover,
.menu .menu-legal a[role="menuitem"]:focus-visible {
  background: none;
  color: var(--color-ink);
  text-decoration: underline;
}

/* ── an error page: a whole-page moment ────────────────────
   Nejma sorry at 132, the title a Heading, the sentence a Body in ink 2, then the main button
   (portalSmallPages/notFoundWide, failedWide). The page itself is its surface: no card. */
.errorcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 24px;
  text-align: center;
}
.errorcard .errorface {
  flex: none;
  width: 132px;
  height: 132px;
  margin-bottom: 16px;
}
.errorcard b {
  max-width: 520px;
  color: var(--color-ink);
  font-size: var(--text-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}
.errorcard .errorbody {
  max-width: 520px;
  margin-top: 8px;
  color: var(--color-ink-2);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}
.errorcard .btn {
  margin-top: 24px;
}
/* Signed in, the moment stands in the middle of 780 of a 900 window's column (notFoundWide). */
.mainwrap > .errorcard {
  justify-content: center;
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
}

/* ── the signed-out column, and the legal texts ── */
.solo {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}
/* The logo, then « Espace revendeurs » as an Overline in rose's deep. */
.solo .brandline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 22px;
}
.solo .brandline .eyebrow {
  color: var(--color-rose-deep);
  font-size: var(--text-overline);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-overline);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
}
.solo h1 {
  margin-bottom: 16px;
}
/* A whole-page moment signed out (failedWide): the logo on top, the moment in the middle of the
   window, the legal links at its foot, all centred on the ground. */
.solo.whole {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 56px 20px 36px;
}
.solo.whole .brandline {
  align-items: center;
  margin-bottom: 0;
}
.solo.whole .errorcard {
  flex: 1;
  justify-content: center;
}
.solo.whole .legal-links {
  margin: 0;
}

/* The conditions and the privacy notice: under the door's line, at the foot of the signed-out
   pages (SKI-296), each a Small in muted, underlined. Signed in, they live in the retailer-card
   menu (.menu-legal). */
.legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 8px;
  color: var(--color-muted);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}
.legal-links a {
  color: inherit;
  text-decoration: underline 1px;
  text-underline-offset: 3px;
}
.legal-links a:hover,
.legal-links a:focus-visible {
  color: var(--color-ink);
}
/* ── under 900: the menu becomes two rows at the top ──────
   The logo and the shop's avatar and « … », then the entries as icons of 44 by 44, « Nouveau » a
   dot and a count a disc on the icon; the help card hidden, Messages is in the row (SKI-336). The
   window scrolls. */
@media (max-width: 900px) {
  .shell {
    display: block;
    min-height: 0;
  }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 10px 12px 8px;
  }
  .sidebar .brand {
    align-items: center;
    height: var(--spacing-control);
    padding: 0 4px;
  }
  .sidebar .bottom {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .help {
    display: none;
  }
  .retailercard {
    gap: 4px;
    padding: 0;
  }
  .retailercard > div {
    display: none;
  }
  .retailercard .avatar {
    width: 32px;
    height: 32px;
  }
  .retailercard .menubtn {
    width: var(--spacing-control);
    height: var(--spacing-control);
    margin-inline: 0;
  }
  .nav {
    order: 3;
    width: 100%;
    flex-direction: row;
    gap: 4px;
  }
  .nav a {
    justify-content: center;
    width: var(--spacing-control);
    height: var(--spacing-control);
    padding: 0;
  }
  .nav a .ph {
    width: 22px;
    height: 22px;
  }
  .nav a .txt {
    display: none;
  }
  .nav a .fresh {
    position: absolute;
    left: 29px;
    top: 8px;
    width: 8px;
    height: 8px;
    padding: 0;
    overflow: hidden;
    background: var(--color-rose-deep);
    color: transparent;
  }
  .nav a .count {
    position: absolute;
    left: 26px;
    top: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    line-height: 16px;
  }
  .mainwrap {
    max-width: none;
    padding: 12px 16px 40px;
  }
  .mainwrap > .errorcard {
    min-height: 0;
  }
}
/* Under 600, as portal/homePhone: the icons across the row, the head's button the column's width
   under the name. SKI-1378: eight for an admin while « Livraison » exists (board 9), so the row
   spreads them with no gap of its own: 8 × 44 fit 390 less its sides. */
@media (max-width: 600px) {
  .nav {
    justify-content: space-between;
    gap: 0;
  }
  .pagehead {
    gap: 14px;
  }
  .pagehead > div:first-child {
    gap: 6px;
  }
  .pagehead > :not(:first-child) {
    flex: 1 1 100%;
  }
  .pagehead .btn {
    width: 100%;
  }
}
