/* Fidelyo's own pages (owner, account, sign-in and the counter), on top of the shared base sheet
   (base.css): the demo's app.css, uncut (decision 0), the top bar and the main column. */
/* Fidelyo app: counter, staff, owner, ATA admin and the demo index. Fidelyo's ink (encre) for actions and
   selection; the counter ground is yellow with 7:1 text and buttons (DR D17). */
body.app { --accent: var(--primary); background: var(--surface); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 4px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-shop { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.0625rem; line-height: 1.2; min-width: 0; }
.topbar-shop > span:last-child { display: grid; min-width: 0; }
.topbar-role { font-weight: 400; font-size: 0.875rem; color: var(--text-soft); }
.topbar .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; flex: none; }
.topbar .mark { width: 16px; height: 23px; color: var(--primary); flex: none; }
.topbar .ghost { font-size: 0.95rem; white-space: nowrap; }
.app-main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px var(--gutter) 32px; display: grid; gap: 24px; align-content: start; }
.app-main.narrow { max-width: 480px; }

/* Demo index */
.ix-start { max-width: 480px; }
.ix-group { display: grid; gap: 8px; align-content: start; }
.ix-group h2 { padding-bottom: 4px; }
.ix-screen { border-bottom: 1px solid var(--line); }
.ix-screen:first-child { border-top: 1px solid var(--line); }
.ix-screen > a { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; min-height: 52px; }
.ix-screen summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; min-height: 52px; cursor: pointer; }
.ix-name { font-weight: 700; }
.ix-states { display: grid; padding: 0 0 12px 16px; }
.ix-states a { display: flex; align-items: center; min-height: 44px; }
@media (min-width: 1024px) { .ix { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; } .ix > .stack, .ix > .actions, .ix > p { grid-column: 1 / -1; } }

/* The bar's content in an inner row, so a page can hold it to its own column (the counter's 560 px, counter.css)
   while the owner's bar keeps it the full width. The shop's name takes up to two lines and the bar grows to fit:
   56 px with one line, about 72 px with two, the name and role 4 px clear of the bar's padding (Edem, 2026-11-12),
   on their own box, so the counter's 48 px link around them (app.css's Fidelyo additions) leaves a one-line bar at
   56 px. A longer name is cut with an ellipsis on its second line; its whole text stays in the page and its title.
   A single word too long for the line breaks, without a hyphen, rather than push the page wider. « Changer de
   boutique » stays one line, a 48 px target that never shrinks (decision 10): the name is what gives way. The row's
   gaps are 8 px, not 12 and 10, so a branch's number stays on the name's second line at 320 px (« Belle » /
   « Coiffure 1 »: 83 px of a column 81 px wide with the wider gaps, measured in Fidelyo Atkinson 800). A 48 px
   control in the 56 px bar has 4 px above and below it: its 3 px ring sits on its edge, not 2 px out, so the ring
   stays inside the bar. A two-line name is balanced, so a branch's number never stands alone on the second line
   (« Belle Coiffure » / « 1 » at 360 px), as the poster's name is. */
.topbar-row { width: 100%; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topbar-row > .topbar-shop { gap: 8px; }
.topbar-shop > span:last-child { padding-block: 4px; }
.topbar-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: break-word; text-wrap: balance; }
.topbar-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-row > .ghost { flex: none; }
.topbar-row :focus-visible { outline-offset: 0; }
/* ---- Fidelyo additions: markup the app has and the demo doesn't */
/* At the counter of a member of several shops, the dot, name and role are one 48 px link to the branch
   switcher (COPY « Counter », Q 26): laid out as the bar's own row, in the bar's text colour, with the row's
   8 px gap, so a linked name wraps where the plain one does (« Belle » / « Coiffure 1 » at 320 px, above) */
.topbar-shop-link { display: flex; align-items: center; gap: 8px; min-height: 48px; min-width: 0; color: inherit; text-decoration: none; }
.topbar-shop-link > span:last-child { display: grid; min-width: 0; padding-block: 4px; }
/* The owner's « Changer de boutique » is a form button (it changes the session): the form takes no room, and it
   keeps its one line beside a long name, as the demo's link does (app.css above) */
.topbar form { margin: 0; }
.topbar-row > form { flex: none; }
/* The counter's « Se déconnecter » (Edem, 2026-11-13: « Second row, small phones only »): on one line beside
   « Changer de boutique » where the bar has room, else on a second row of the bar, right-aligned. Below
   600 px the two one-line ghosts would leave the name too little room (about 330 px of them) */
@media (max-width: 599.98px) {
  .topbar-row.has-sign-out { flex-wrap: wrap; row-gap: 0; }
  .topbar-row.has-sign-out > .topbar-shop { flex: 1 1 0; }
  .topbar-row.has-sign-out > .topbar-sign-out { flex: 1 0 100%; display: flex; justify-content: flex-end; }
  /* Its row touches the switch's (no row gap: the 640 px-tall counter has no pixel to spare), so its ring is
     drawn inside its own box, never over « Changer de boutique » */
  .topbar-row.has-sign-out > .topbar-sign-out :focus-visible { outline-offset: -3px; }
}
/* « Retour » after a sign-out (shell.js): a page the history cache brought back stays unseen while its session
   is checked, so no customer's name shows before the answer */
html.is-checking-session body { visibility: hidden; }
/* A radio or checkbox inside a .field is a box, not a text box (docs/DESIGN-INVENTORY.md, finding 3.2): base.css's
   `.field input` draws text inputs 100 % wide, and a hand-written or Django radio group sits in a fieldset.field.
   Here, not in base.css, for the customer pages' 8 KB gzipped budget: they have no such group or loose control
   (the rating hides its radios, join uses check rows).
   :where() keeps the rule at `.field input`'s weight, so the selection slabs' hidden radio (.choice input) and the
   check row's box (.check input) keep their own size and margin. A label holding its box is a 48 px row. */
.field input:where([type="radio"], [type="checkbox"]) { flex-shrink: 0; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; accent-color: var(--accent); }
.field label:has(> input:where([type="radio"], [type="checkbox"])) { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 400; cursor: pointer; }
/* A text input, select or textarea outside a .field (#180's date and time, #175's reward selects) still has the
   field's look. No weight at all, so any rule that draws a control, .field's included, wins over it. */
:where(input:not([type="radio"], [type="checkbox"], [type="hidden"], [type="file"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="range"], [type="color"]), select, textarea) { max-width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--text-soft); border-radius: var(--r); background: var(--surface); color: var(--text); font: 400 1.0625rem/1.3 var(--font); }
