/* Portal v3, phase 1 (PHASE-1-PROMPT.md html.portal-v3:not([data-skin])9): view tabs, filter chips, the segmented control and the period pill, under
   html.portal-v3 only. The existing tab rows (Seg's role=tablist rows, .utabs, Finance's period) and chips take this look
   by CSS with their behaviour unchanged; a Seg inside a dialog or a form (UI v2 kept those as a control) and the period
   bars of Reports and Ratings (.pbar2) are the segmented control. Four ids win over UI v2's portal tabs (three). */

/* ---------- view tabs: 44 px row, 24 px apart, 16 px words; the chosen one in ink with a 2 px blue line exactly its width,
   on the row's 1 px line ---------- */
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg)):not(#p1):not(#p2):not(#p3):not(#p4){position:relative;display:flex;flex-wrap:nowrap;gap:24px;width:auto;max-width:100%;padding:0;border:0;border-radius:0;background:transparent;box-shadow:inset 0 -1px 0 var(--p3-line);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;isolation:auto}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>.seg-th:not(#p1):not(#p2):not(#p3):not(#p4){display:none}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:not(#p1):not(#p2):not(#p3):not(#p4){position:relative;z-index:auto;display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;min-width:0;height:44px;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--p3-muted);font-family:var(--p3-ff);font-size:14px;line-height:20px;font-weight:400;letter-spacing:0;text-transform:none;white-space:nowrap;transition:color var(--p3-fast) var(--p3-ease)}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:hover:not(:disabled):not(#p1):not(#p2):not(#p3):not(#p4){color:var(--p3-text)}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:is(.on,[aria-selected=true],[aria-pressed=true]):not(#p1):not(#p2):not(#p3):not(#p4){color:var(--p3-text);background:transparent}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:not(#p1):not(#p2):not(#p3):not(#p4)::after{content:'';position:absolute;inset:auto 0 0;height:2px;border-radius:0;background:var(--p3-primary);transform:scaleX(0);transition:transform var(--p3-med) var(--p3-ease)}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:is(.on,[aria-selected=true],[aria-pressed=true]):not(#p1):not(#p2):not(#p3):not(#p4)::after{transform:none}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button>:not(svg):not(#p1):not(#p2):not(#p3):not(#p4){font:inherit;letter-spacing:inherit}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:focus-visible:not(#p1):not(#p2):not(#p3):not(#p4){outline:2px solid var(--p3-primary);outline-offset:-2px;border-radius:4px}
html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs)>button>.p3-cnt:not(#p1):not(#p2):not(#p3):not(#p4),html.portal-v3:not([data-skin]) .p3-cnt{color:var(--p3-muted);font-size:13px;line-height:18px;font-variant-numeric:tabular-nums}

/* ---------- the segmented control: a soft track, a surface thumb sliding 200 ms ---------- */
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg)):not(#p1):not(#p2):not(#p3):not(#p4){position:relative;display:inline-flex;flex-wrap:nowrap;gap:0;width:auto;max-width:100%;min-height:32px;padding:3px;border:0;border-radius:var(--p3-r-chip);background:var(--p3-soft);box-shadow:none;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;isolation:isolate;vertical-align:middle}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>:is(.seg-th,.p3-seg-th):not(#p1):not(#p2):not(#p3):not(#p4){display:block;position:absolute;z-index:0;top:3px;bottom:3px;left:0;border-radius:6px;background:var(--p3-surface);box-shadow:var(--p3-shadow-thumb),inset 0 0 0 1px var(--p3-pop-line);transition:transform var(--p3-med) var(--p3-ease),width var(--p3-med) var(--p3-ease),opacity var(--p3-fast)}
html.portal-v3:not([data-skin]) :is(.p3-seg,.seg)>:is(.seg-th,.p3-seg-th):not([data-ready]):not(#p1):not(#p2):not(#p3):not(#p4){transition:none}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>button:not(#p1):not(#p2):not(#p3):not(#p4){position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:1 1 0;min-width:max-content;height:26px;min-height:26px;padding:0 12px;border:0;border-radius:6px;background:transparent;box-shadow:none;color:var(--p3-muted);font-family:var(--p3-ff);font-size:15px;line-height:20px;font-weight:400;letter-spacing:0;text-transform:none;white-space:nowrap;transition:color var(--p3-med) var(--p3-ease)}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>button:is(.on,[aria-checked=true],[aria-selected=true],[aria-pressed=true]):not(#p1):not(#p2):not(#p3):not(#p4){color:var(--p3-text);background:transparent}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg)):not(:has(>:is(.seg-th,.p3-seg-th):not([hidden])))>button:is(.on,[aria-checked=true],[aria-selected=true]):not(#p1):not(#p2):not(#p3):not(#p4){background:var(--p3-surface);box-shadow:var(--p3-shadow-thumb)}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>button:hover:not(:disabled):not(#p1):not(#p2):not(#p3):not(#p4){color:var(--p3-text)}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>button:focus-visible:not(#p1):not(#p2):not(#p3):not(#p4){outline:2px solid var(--p3-primary);outline-offset:0}
html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>button>:not(svg):not(#p1):not(#p2):not(#p3):not(#p4){font:inherit}

/* ---------- filter chips: 32 px, 10 px corners, a 1 px line on the surface; chosen: the tint, blue words ---------- */
html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip):not(#p1):not(#p2):not(#p3):not(#p4){position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;min-height:32px;padding:0 12px;border:1px solid var(--p3-line);border-radius:var(--p3-r-field);background:var(--p3-surface);box-shadow:none;color:var(--p3-text);font-family:var(--p3-ff);font-size:15px;line-height:20px;font-weight:400;letter-spacing:0;text-transform:none;white-space:nowrap;cursor:pointer;transition:background-color var(--p3-fast) var(--p3-ease),border-color var(--p3-fast) var(--p3-ease),color var(--p3-fast) var(--p3-ease)}
html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip:not(.p3-rm)):hover:not(:disabled):not(.on):not(#p1):not(#p2):not(#p3):not(#p4){background:var(--p3-hover)}
html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip).on:not(#p1):not(#p2):not(#p3):not(#p4){border-color:transparent;background:var(--p3-tint);color:var(--p3-link)}
html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip) :is(small,.cn,.p3-cnt):not(#p1):not(#p2):not(#p3):not(#p4){margin:0;color:var(--p3-muted);font-size:13px;font-weight:400}
html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip):focus-visible:not(#p1):not(#p2):not(#p3):not(#p4){outline:2px solid var(--p3-primary);outline-offset:2px}
html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip):disabled:not(#p1):not(#p2):not(#p3):not(#p4){opacity:.4;cursor:not-allowed}
html.portal-v3:not([data-skin]) :is(.chip,.p3-chip)>svg:not(#p1):not(#p2):not(#p3):not(#p4){flex:none}
html.portal-v3:not([data-skin]) .p3-chips{display:flex;flex-wrap:wrap;gap:8px}
/* the removable chip: a 16 px × at its end; dashed: a dashed line on the surface (active filters on person pages) */
html.portal-v3:not([data-skin]) .p3-chip.p3-rm:not(#p1):not(#p2):not(#p3):not(#p4){padding-inline-end:6px;cursor:default}
html.portal-v3:not([data-skin]) .p3-chip.p3-rm.dashed:not(#p1):not(#p2):not(#p3):not(#p4):not(#p5){border:1px dashed color-mix(in srgb,var(--p3-muted) 55%,transparent);background:var(--p3-surface);color:var(--p3-text)}
html.portal-v3:not([data-skin]) .p3-rm-x{position:relative;display:grid;place-items:center;flex:none;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer}
html.portal-v3:not([data-skin]) .p3-rm-x:hover{background:color-mix(in srgb,currentColor 12%,transparent)}
html.portal-v3:not([data-skin]) .p3-rm-x:focus-visible{outline:2px solid var(--p3-primary);outline-offset:1px}
@media (pointer:coarse){
  html.portal-v3:not([data-skin]) :is(.chip:not(.static):not(.saved),.p3-chip):not(#p1):not(#p2):not(#p3):not(#p4)::after{content:'';position:absolute;inset:auto;top:50%;left:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
  html.portal-v3:not([data-skin]) .p3-rm-x::after{content:'';position:absolute;inset:auto;top:50%;left:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
  /* the till's payment method chips (TenderPicker) keep today's full 44 px on touch (gym.css), as tests/e2e/pos-split.mjs measures:
     a money action whose neighbours sit 4 px apart, so the 44 px hit area alone would overlap them */
  html.portal-v3:not([data-skin]) .tender-row .chip:not(.static):not(#p1):not(#p2):not(#p3):not(#p4){height:44px;min-height:44px}
}

/* ---------- the period pill and the stepper beside it ---------- */
html.portal-v3:not([data-skin]) .pnav2.p3-pnav:not(#p1):not(#p2):not(#p3):not(#p4){display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;min-width:0;max-width:100%}
html.portal-v3:not([data-skin]) .p3-pill-btn{position:relative;display:inline-flex;align-items:center;gap:8px;flex:none;height:32px;margin:0;padding:0 12px 0 14px;border:1px solid var(--p3-line);border-radius:var(--p3-r-pill);background:var(--p3-surface);color:var(--p3-text);font-family:var(--p3-ff);font-size:15px;line-height:20px;font-weight:400;white-space:nowrap;cursor:pointer;transition:background-color var(--p3-fast) var(--p3-ease)}
html.portal-v3:not([data-skin])[dir=rtl] .p3-pill-btn{padding:0 14px 0 12px}
html.portal-v3:not([data-skin]) .p3-pill-btn:hover{background:var(--p3-hover)}
html.portal-v3:not([data-skin]) .p3-pill-btn:focus-visible{outline:0;box-shadow:0 0 0 2px var(--p3-bg),0 0 0 4px var(--p3-primary)}
html.portal-v3:not([data-skin]) .p3-pill-btn .p3-caret{width:12px;height:12px;background:var(--p3-muted);clip-path:none;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat}
html.portal-v3:not([data-skin]) .pnav2 .pnav.p3-step:not(#p1):not(#p2):not(#p3):not(#p4){display:inline-flex;align-items:center;gap:8px;flex:none}
html.portal-v3:not([data-skin]) .pnav.p3-step .icon-btn.p3-rib:not(#p1):not(#p2):not(#p3):not(#p4){width:32px;height:32px;min-width:32px;min-height:32px;padding:0;border:0;border-radius:50%;background:var(--p3-soft);color:var(--p3-text)}
html.portal-v3:not([data-skin]) .pnav.p3-step .icon-btn.p3-rib>svg:not(#p1):not(#p2):not(#p3):not(#p4){width:18px;height:18px}
html.portal-v3:not([data-skin]) .pnav.p3-step .icon-btn.p3-rib:disabled:not(#p1):not(#p2):not(#p3):not(#p4){opacity:.4}
html.portal-v3:not([data-skin]) .pnav.p3-step .month-lab:not(#p1):not(#p2):not(#p3):not(#p4){min-width:84px;text-align:center;color:var(--p3-text);font-family:var(--p3-ff);font-size:14px;line-height:20px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
@media (pointer:coarse){html.portal-v3:not([data-skin]) .pnav.p3-step .icon-btn.p3-rib:not(#p1):not(#p2):not(#p3):not(#p4)::after,html.portal-v3:not([data-skin]) .p3-pill-btn::after{content:'';position:absolute;inset:auto;top:50%;left:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}}
@media (max-width:599px){
  html.portal-v3:not([data-skin]) .gtop>.pnav2.p3-pnav:not(#p1):not(#p2):not(#p3):not(#p4),html.portal-v3:not([data-skin]) .gtop>.row-actions>.pnav2.p3-pnav:not(#p1):not(#p2):not(#p3):not(#p4){width:100%;justify-content:space-between}
  html.portal-v3:not([data-skin]) .pnav2 .pnav.p3-step:not(#p1):not(#p2):not(#p3):not(#p4){flex:none;justify-content:flex-end}
}
@media (pointer:coarse){html.portal-v3:not([data-skin]) :is(.p3-seg,.pbar2>.seg,.seg.mini,:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg:not(.pn-seg>.seg):not(.fh-seg>.seg))>button:not(#p1):not(#p2):not(#p3):not(#p4)::after{content:'';position:absolute;inset:auto;top:50%;left:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}}
/* touch: a view tab whose words are narrower than 44 px gets a 44 px wide touch area (its ::after is the blue line), as
   overrides.css gives .utabs; the touch areas of the chips, the removable chip's x, the period pill, its arrows and the
   segmented control are sized boxes (min 44 x 44, centred), so the layout check's tap-target test can read them
   (wave 3, rule 13) */
@media (pointer:coarse){html.portal-v3:not([data-skin]) :is(.p3-tabs,.utabs,.fh-seg>.seg,.seg:not(.pn-seg>.seg):not(.pbar2>.seg):not(.fh-seg>.seg):not(.mini):not(:is(.gmodal,.modal,.g3,.overlay,[role=dialog]) .seg))>button:not(#p1):not(#p2):not(#p3):not(#p4)::before{content:'';position:absolute;top:0;left:50%;width:max(100%,44px);height:44px;transform:translateX(-50%)}}
