/* Round 8 — no ellipsis and no clipped label at 1366x768, 1440x900, 1536x864 and 1920x1080, ES and EN.
   Layout, panels, colours, sea and river are unchanged: only truncation rules are replaced by wrapping or room. */

/* River bottleneck chip: the flags sit two or more stages apart, so a chip may use up to a quarter of the river. */
html body #main .river .rv-water .flag { max-width: calc(100% / 4 - 16px); }
html body #main .river .rv-water .flag > span { overflow: visible; text-overflow: clip; white-space: nowrap; }

/* Map title: wraps onto a second line (never an ellipsis) when the zoom buttons share the header. */
@media (min-width: 1280px) {
  html body #main .atlas .ach > h2 { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.12; display: flex; align-items: center; min-height: var(--r4-chip); }
}

/* Watch list rows and call summary lines: wrap inside the row instead of cutting the label. */
html body #main .decide .decision .dt > span:not(.sr) { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.12; }
html body #main .verify.pv > .sub { overflow: visible; text-overflow: clip; }
html body #main .verify.pv > .ti-empty :is(b, span) { overflow: visible; text-overflow: clip; }

/* People card: the activity strip and the sales-people note wrap rather than cut. */
html body #main .bottom .card-scroll > .ppl-af { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
html body #main .bottom .card-scroll > .ppl-af .af-tag { overflow: visible; text-overflow: clip; flex: 0 0 auto; }
html body #main .bottom .ppl-h .ppl-txt { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.15; }

/* Card headers: the two header pills give a little room back so the card title is never shortened. */
html body #main .bottom .ch :is(.dept-pill, .dept-big.pill) { padding: 0 8px; }
html body #main .bottom .ch h3 { overflow: visible; text-overflow: clip; }

/* ======================= Inventory: clearly visible product images, same five rows ======================= */
@media (min-width: 1280px) {
  html body #main .bottom > .card:has(> .inv-products) { row-gap: 4px; }
  html body #main .bottom .inv-tile { padding: 0 10px 0 4px; gap: 8px; }
  /* Owner round 10.4: the photo sits fully inside its row with at least 4 px of padding on every side: 44 px where the row has room, otherwise the row's height. */
  html body #main .bottom .inv-tile .inv-tile__stage,
  html body #main .bottom .inv-tile.has-photo .inv-tile__stage { flex: none; align-self: center; height: min(44px, calc(100% - 8px)); width: auto; aspect-ratio: 1 / 1; margin-block: 0; overflow: visible; }
  html body #main .bottom .inv-tile__photo { filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
}
@media (min-width: 1600px) and (min-height: 941px) {
  /* A 40-44 px photo with 4 px of padding needs a row of at least 50 px: three whole rows at 1920 x 1080. Every product stays in the list, which scrolls inside the panel. */
  html body #main .bottom > .card > .inv-products { --r4-rows: 3; }
}
@media (min-width: 1600px) {
  /* Wide cards: units over the low-stock chip, so the product name keeps its room and never clips. */
  html body #main .bottom .inv-tile__meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 8px; row-gap: 0; }
  html body #main .bottom .inv-tile__meta > b { grid-column: 1; grid-row: 1 / 3; }
  html body #main .bottom .inv-tile__meta > .inv-tile__units { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  html body #main .bottom .inv-tile__meta:has(> .inv-chip) > .inv-tile__units { grid-row: 1; align-self: end; line-height: 1.1; }
  html body #main .bottom .inv-tile__meta > .inv-chip { grid-column: 2; grid-row: 2; align-self: start; justify-self: end; height: auto; padding: 0 6px; line-height: 1.15; }
}
@media (min-width: 1280px) and (max-width: 1599px) {
  /* Narrow inventory card: tighter gaps so product names keep two whole lines. */
  html body #main .bottom .inv-tile { gap: 5px; padding-right: 8px; }
  html body #main .bottom .inv-tile__meta { gap: 6px; }
  html body #main .bottom .inv-tile__meta > .inv-tile__units { min-width: 0; }
}

/* Round 10: inventory pictures are the manufacturer's own images, contained in the row's picture slot. */
.inv-tile__photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
#records .rec-product .inv-tile__photo { height: 100%; filter: none; }

/* While the access card or the sign-in page is up only it and AQUIS show (one AQUIS on every surface). The panels leave the
   layout altogether: a skeleton dashboard was cut off by the viewport, and the sea's text masks still cut holes around hidden boxes. */
html body #main > #dash[hidden] { display: block; }
html body #main > #dash[hidden] :not(:has(#aquis)):not(#aquis, #aquis *),
html body #main:has(> #ceo-axs-host:not([hidden])) #dash :not(:has(#aquis)):not(#aquis, #aquis *) { display: none; }

/* Busy-dealer fit (L1): installs figures stay on one line, a long watch-list label grows its row (the list scrolls inside the card), and the role mix keeps every role whole. */
@media (min-width: 1280px) {
  html body #main .verify.pv { gap: 5px; }
  html body #main .verify.pv > :is(.ti, .bar, .calls-legend, .sub) { margin: 0; }
  html body #main .verify.pv > .bar { height: 6px; }
  html body #main .verify.pv > .bl:not(:has(> span:only-child)) { flex: 0 0 26px; display: flex; height: 26px; min-height: 26px; max-height: 26px; gap: 6px; }
  html body #main .verify.pv > .bl:not(:has(> span:only-child)) > span { flex: 1 1 auto; gap: 4px; padding: 0 6px; font-size: 11.5px; line-height: 1.1; white-space: nowrap; overflow: visible; }
  html body #main .verify.pv > .bl:not(:has(> span:only-child)) > span > i { flex: none; margin: 0; }
  /* Watch list: the frame's fill contract. Equal rows tall enough for a two-line label share the list; --ceo-extra (ceo-frame.js) spreads what whole rows leave over. */
  html body #main .decide > .decisions { display: grid; gap: 3px; overflow-y: auto; grid-auto-rows: minmax(calc(30px + var(--ceo-extra, 0px)), 1fr); align-content: stretch; scrollbar-width: thin; }
  html body #main .decide .decision { height: 100%; min-height: 0; padding-block: 0; box-sizing: border-box; }
  /* People with a role mix: the frame chooses up to four equal rows with room for a 32px avatar and its row borders. Each role has its own snap point. The list sits above the card's cover so the wheel reaches it; ceo-frame.js passes a click on a row to the cover. */
  html body #main .bottom > .card:has(.ppl-roles) > .card-scroll { display: grid; position: relative; z-index: 2; pointer-events: auto; cursor: pointer; overflow-y: auto; scrollbar-width: thin; gap: 3px; grid-template-rows: none; grid-auto-rows: var(--ceo-people-row-height, calc((100% + 3px) / var(--ceo-people-rows, 4) - 3px)); }
  html body #main .bottom .card-scroll .people-extra > * { scroll-snap-align: start; }
  html body #main .bottom .card-scroll .people-extra > .ppl-roles { display: contents; }
  html body #main .bottom .card-scroll .people-extra > .ppl-roles .ppl-rolebar { order: 6; min-width: 0; height: 100%; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--platform-row-line); border-radius: 12px; background: var(--platform-row); grid-template-columns: minmax(0, max-content) minmax(24px, 1fr) auto; scroll-snap-align: start; }
  html body #main .bottom .card-scroll .people-extra > .ppl-roles .ppl-rolebar__lab { overflow: visible; }
}
@media (min-width: 1280px) and (max-width: 1365px) {
  html body #main .verify.pv > .bl:not(:has(> span:only-child)) { gap: 4px; }
  html body #main .verify.pv > .bl:not(:has(> span:only-child)) > span { gap: 3px; padding: 0 3px; font-size: 11px; }
}
@media (max-width: 1279px) {
  html body #main .ppl-rolebar { grid-template-columns: max-content minmax(24px, 1fr) auto; }
  html body #main .ppl-rolebar__lab { overflow: visible; }
}

/* Compact verification keeps one whole call and its status. The install counts share
   one row; the decorative progress bar and duplicate status key yield to the calls. */
@media (min-width: 1280px) {
  html body #main .verify.pv[data-ceo-compact] { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto minmax(40px, 1fr) auto; gap: 3px 8px; padding-block: 12px; }
  html body #main .verify.pv[data-ceo-compact] > :is(.ch, .sub, .calls, .ti-empty) { grid-column: 1 / -1; }
  html body #main .verify.pv[data-ceo-compact] > .calls { grid-row: 3; min-height: 40px; }
  html body #main .verify.pv[data-ceo-compact] > :is(.bar, .calls-legend) { display: none; }
  html body #main .verify.pv[data-ceo-compact] > .ti { grid-row: 4; margin: 0; align-self: center; font-size: 11.5px; }
  html body #main .verify.pv[data-ceo-compact] > .ti-empty { min-height: 42px; font-size: 12px; }
  html body #main .verify.pv[data-ceo-compact] > .bl { grid-row: 4; min-width: 0; }
}
