/* Tests: tests/InsuranceBroker.Ammn.Tests/Layouts/AppHeadStylesheetTests.cs (linked once, after the sheets it refines),
   tests/InsuranceBroker.Ammn.Tests/Components/Medical/MedicalFlowStylesheetTests.cs (every rule scoped, tokens only) */

/* ================================================================
   GROUP MEDICAL — the design pass for the Medical screens only.

   wizard.css, service.css and the popup sheets serve all six products. Everything in this file is
   scoped under .medical-flow, the class on the Medical page roots: the service page
   (MedicalServicePage), the step-1 form (CompanyDetailsStep, popup and inline) and the wizard
   (MedicalWizardPage). Drawers are portaled to .ammn-wizard, outside that root, so their rules
   hang off `.ammn-wizard:has(.medical-flow)` — still only a page that renders the Medical root.

   Colours come only from theme.tokens.css. Linked last in App.razor's head, so it refines the
   shared sheets at equal or higher specificity without touching another product.
   ================================================================ */


/* ----------------------------------------------------------------
   1. SERVICE PAGE  (/landing/wizard/medical)
   ---------------------------------------------------------------- */

/* The hero filled 100vh BELOW the header, so its text and buttons sat on the bottom edge of the first
   screen — exactly where the chat button floats (32px from the bottom, 56px tall). It covered the first
   word of the description on desktop and the "Buy now" button on phones. A shorter hero and a bottom
   gutter taller than the chat button keep the call to action clear of it on the first screen. */
.medical-flow .sec-homepage,
.medical-flow .homepage {
  min-height: 86vh;
  min-height: 86svh;
  height: auto;
}

.medical-flow .blur-section {
  padding-bottom: 112px;
}

@media (max-width: 768px) {
  .medical-flow .sec-homepage,
  .medical-flow .homepage {
    min-height: 72vh;
    min-height: 72svh;
  }

  .medical-flow .blur-section {
    padding-bottom: 40px;
  }
}

/* The label stays beside the spinner while the page wakes up (HeroSection.KeepLabelWhileLoading),
   so a phone never shows a green bar with only a spinner in it. */
.medical-flow .hero-btn-primary--loading {
  gap: 12px;
}

.medical-flow .hero-btn-primary--loading .hero-btn-spinner {
  flex: 0 0 auto;
}

/* Why choose us. A sideways strip of 390px cards with no scrollbar and no arrows: on a desktop the
   fifth card was cut at the edge with nothing to say there was more. On a wide screen every card fits
   on one row, so they become a grid and the scroll indicator goes. Phones keep the swipe strip. */
@media (min-width: 1025px) {
  .medical-flow .sme-progress {
    display: none;
  }

  .medical-flow .sme-viewport {
    overflow: visible;
    padding-block: 28px 56px;
  }

  .medical-flow .sme-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding-inline: 80px;
  }

  .medical-flow .sme-card {
    flex: none;
    min-width: 0;
    padding: 22px 20px;
  }
}

/* Coverage. The stacked cards were cycled by two buttons that never worked (the section is
   server-rendered, so their clicks have no handler), labelled in English on the Arabic page, and the
   section was forced to a full screen height around 520px of content. Every card is now visible: a
   swipe strip on phones and tablets, a grid on desktop. The dead buttons are hidden. */
.medical-flow .stack-layout {
  height: auto;
  padding-block: 72px;
  align-items: flex-start;
}

.medical-flow .stack-nav-btn {
  display: none;
}

.medical-flow .stack-section1 {
  display: flex;
  gap: 16px;
  height: auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  align-items: stretch;
  justify-content: flex-start;
  padding-block: 4px 16px;
  scrollbar-width: thin;
}

.medical-flow .stack-section1 .blue-card {
  position: relative;
  flex: 0 0 min(320px, 82%);
  display: flex;
  align-items: flex-end;
  width: auto;
  height: auto;
  min-height: 300px;
  opacity: 1;
  transform: none;
  z-index: auto;
  scroll-snap-align: start;
  box-shadow: var(--shadow-md);
}

.medical-flow .stack-section1 .blue-card-text {
  position: relative;
  inset: auto;
  padding: 120px 24px 24px;
}

.medical-flow .stack-section1 .blue-card h3 {
  font-size: 20px;
  line-height: 28px;
}

.medical-flow .stack-section1 .blue-card p {
  font-size: 15px;
}

/* service.css sizes the old stack on phones with !important; the strip has to answer in kind. */
@media (max-width: 768px) {
  .medical-flow .stack-layout {
    padding-block: 48px;
  }

  .medical-flow .stack-section1 {
    height: auto !important;
  }

  .medical-flow .stack-section1 .blue-card {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    inset: auto !important;
  }
}

@media (min-width: 1025px) {
  .medical-flow .stack-layout {
    flex-direction: column;
    gap: 32px;
  }

  .medical-flow .left-content {
    width: 100%;
    margin: 0;
  }

  .medical-flow .stack-section1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    width: 100%;
    overflow: visible;
  }

  .medical-flow .stack-section1 .blue-card {
    min-height: 320px;
  }
}

/* One call to action, one look. The coverage section's button was a different (blue) button with different words,
   and it did nothing. It is now a link to the same capture popup wearing the hero's own .hero-btn-primary
   (CoverageStackSection.BuyHref), at the hero's own size (QA, 2026-11-12: in English one was upper case and taller);
   only its place is set here. Neither is set in capitals. */
.medical-flow .hero-btn-primary {
  text-transform: none;
}

.medical-flow .left-content .stack-buy {
  margin-top: 24px;
}

.medical-flow .left-content .stack-buy:focus-visible,
.medical-flow .hero-btn-primary:focus-visible,
.medical-flow .hero-btn-secondary:focus-visible {
  outline: 3px solid var(--brand-blue-light);
  outline-offset: 3px;
}

/* The dark benefits grid ended in a 200px empty band before the footer. */
.medical-flow .benefits-grid {
  padding-bottom: 0;
  margin-bottom: 0;
}

.medical-flow .benefits-section {
  padding-bottom: 72px;
}


/* ----------------------------------------------------------------
   2. STEP 1 — the company form (landing popup and the wizard's inline card)
   ---------------------------------------------------------------- */

/* The popup on a desktop (owner, 2026-11-12: "not clear"). A 640px card of 13px text in pale grey floated in the
   blurred page. Medical's card is a comfortable 500px; text is 16px, labels 14px+ in a readable ink, and the
   primary action is Motor's: the brand green with its dark contrast ink (white on the light end of the old
   gradient measured under 2:1). `:has(.medical-flow)` keeps this to the Medical popup. */
@media (min-width: 561px) {
  .hq-modal--wizard:has(.medical-flow) {
    width: 500px;
    padding: 36px 32px 28px;
  }
}

.hq-modal:has(.medical-flow) .hq-modal__subtitle {
  color: var(--n400);
  font-size: 16px;
  line-height: 1.6;
}

/* The popup's own sheet points --wf-label at its pale muted grey (about 3.4:1); one level more specific wins it back. */
.medical-flow .ibs-input,
.ammn-wizard:has(.medical-flow) .drawer .ibs-input,
.hq-overlay .hq-modal .medical-flow .ibs-input,
.hq-capture-page .hq-modal .medical-flow .ibs-input {
  --wf-label: var(--n500);
}

/* MudBlazor shrinks an outlined label to 75% once the field has a value or a placeholder, so 14px / 0.75 shows as 14px.
   The border's notch (the legend) is sized from its own font, so it grows to the same 14px or the line would cross
   the label. */
.medical-flow .ibs-input label.mud-input-label,
.ammn-wizard:has(.medical-flow) .drawer .ibs-input label.mud-input-label {
  font-size: calc(14px / 0.75);
  font-weight: 600;
}

.medical-flow .ibs-input .mud-input.mud-input-outlined .mud-input-outlined-border legend,
.ammn-wizard:has(.medical-flow) .drawer .ibs-input .mud-input.mud-input-outlined .mud-input-outlined-border legend {
  font-size: 14px;
  font-weight: 600;
}

.medical-flow .ibs-input .mud-input-slot.mud-input-root {
  font-size: 16px;
}

.medical-flow .ibs-recapture__label {
  margin-inline-start: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--n500);
}

.hq-modal .medical-flow .wizard-terms {
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--n500);
}

.hq-modal .medical-flow .wizard-terms .ibs-chk {
  min-width: 24px;
  min-height: 24px;
}

.hq-modal .medical-flow .ibs-btn-row .ibs-btn {
  height: 52px;
  font-size: 16px;
  font-weight: 700;
}

.hq-modal .medical-flow .ibs-btn-row .ibs-btn:not(:disabled) {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  /* Small: the action row is sticky with an 8px foot, and a deep shadow was cut off into a pale band under it. */
  box-shadow: var(--shadow-sm);
}

.hq-modal .medical-flow .ibs-btn-row .ibs-btn:not(:disabled):hover {
  filter: brightness(1.05);
}

/* One field shape. The popup draws its fields as pills; the code field beside the CAPTCHA was an 8px
   box. Same height, radius and border as the registration-number field above it. */
.medical-flow .ibs-recapture__row {
  align-items: center;
  gap: 8px;
}

.medical-flow .ibs-recapture__canvas {
  flex: 0 0 148px;
  height: 56px;
  border-radius: 12px;
  border-color: var(--n40);
  background: var(--n0);
}

.medical-flow .ibs-recapture__field {
  height: 56px;
  padding-inline: 4px;
  border-color: var(--n40);
  border-radius: var(--radius-full);
}

.medical-flow .ibs-recapture__field:hover {
  border-color: var(--n80);
}

.medical-flow .ibs-recapture__field:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.medical-flow .ibs-recapture__field--error,
.medical-flow .ibs-recapture__field--error:hover,
.medical-flow .ibs-recapture__field--error:focus-within {
  border-color: var(--error);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 16%, transparent);
}

/* The refresh button belongs to the picture it replaces, not inside the answer: CompanyDetailsStep renders it between
   the CAPTCHA image and the code field (IbsRecapture.RefreshBesideImage), so it is a plain flex item in the row. */
.medical-flow .ibs-recapture__refresh {
  flex: 0 0 44px;
  border: 1px solid var(--n40);
  border-radius: var(--radius-full);
  background: var(--n0);
  color: var(--brand-green);
}

/* A narrow phone: the image and its refresh take the first line, the answer the full second line. */
@media (max-width: 420px) {
  .medical-flow .ibs-recapture__row {
    flex-wrap: wrap;
  }

  .medical-flow .ibs-recapture__canvas {
    flex: 1 1 0;
  }

  .medical-flow .ibs-recapture__input-slot {
    flex: 1 1 100%;
  }
}

/* "الشروط والأحكام" is a link to /terms; it was painted in the sentence's grey with no underline. */
.medical-flow .wizard-terms__link {
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.medical-flow .wizard-terms__link:hover {
  color: var(--brand-blue-hover);
}

/* A disabled action said nothing at half opacity: white on the faded green measured about 1.6:1.
   It is now a plain neutral pill with dark text, readable in both themes, and plainly not pressable. */
.medical-flow .ibs-btn:disabled,
.medical-flow .endo-footrow > .endo-btn-add:first-child:disabled,
.ammn-wizard:has(.medical-flow) .drawer .ibs-btn:disabled {
  opacity: 1;
  background: var(--n30);
  border-color: var(--n30);
  color: var(--n500);
  box-shadow: none;
}


/* The wizard's own step 1 (DEF-018): a page step like steps 2 and 3, no longer the popup's 500px card centred on the
   page — that left the banner title one word a line, its step label cut at the edge, and the saved companies 320px
   cards in a 384px grid. The saved companies fill the row in columns of at least 280px. The popup (Collect mode) has
   no tabs, no banner and no company cards, so none of this reaches it. */
.medical-flow .page-company-details .my-vehicles__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.medical-flow .page-company-details .vehicle-card {
  width: auto;
  min-width: 0;
}

.medical-flow .page-company-details .vehicle-card__badge {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A company name, not a plate: the plate's monospace and 1px letter-spacing pulled the Arabic letters apart. */
.medical-flow .vehicle-card__plate.medical-company-card__name {
  font-family: inherit;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}

/* The CR field and the CAPTCHA keep a form's width on a wide card rather than a 1000px bar for ten digits. */
@media (min-width: 769px) {
  .ammn-wizard .medical-flow .page-company-details .ibs-input,
  .ammn-wizard .medical-flow .page-company-details .ibs-recapture {
    max-width: 520px;
  }
}


/* ----------------------------------------------------------------
   3. THE WIZARD — shared rhythm for steps 2 and 3
   ---------------------------------------------------------------- */

/* The step bar on a phone (UAT round 2): the current step's label ("جمع البيانات", "Info Gathering") was cut at the
   screen's edge ("…انات"). The bar reaches the page's edges with a negative margin sized for the desktop gutter (80px)
   while the page's gutter shrinks (40px, 14px, 12px): on an Arabic phone it stuck out 68px past the right edge, where
   the page clips it. Its margin now follows the gutter; the labels may take two lines and stay inside. */
@media (max-width: 1200px) {
  .ammn-wizard .medical-flow .steps-bar {
    margin-inline: -40px;
  }
}

@media (max-width: 768px) {
  .ammn-wizard .medical-flow .steps-bar {
    margin-inline: -14px;
  }
}

@media (max-width: 480px) {
  .ammn-wizard .medical-flow .steps-bar {
    margin-inline: -12px;
  }

  .ammn-wizard .medical-flow .steps-wrap {
    padding-inline: 28px;
  }

  .ammn-wizard .medical-flow .step-label {
    max-width: 88px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }
}

/* A language switch that could not save the health declarations first asks before reloading (DEF-068). */
.medical-flow .medical-language-confirm {
  max-width: 880px;
  margin: 12px auto;
}

/* Character counters ("29", "0 / 10") are a length budget for long free text, not for a company name
   or an ID. The popup already hides them; the wizard's own fields and drawers do the same. A validation
   message sits in the same row and still shows. */
.medical-flow .mud-input-helper-text > .ms-auto,
.ammn-wizard:has(.medical-flow) .drawer .mud-input-helper-text > .ms-auto {
  display: none;
}

/* The request's reference under the step bar: a quiet chip, centred, label in the page's language and the number
   left to right. */
.medical-flow .medical-request-ref {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 4px auto 12px;
  padding: 4px 12px;
  border: 1px solid var(--n40);
  border-radius: var(--radius-full);
  background: var(--n0);
  font-size: 12px;
  line-height: 1.5;
  color: var(--n400);
}

.medical-flow .medical-request-ref__no {
  font-weight: 600;
  color: var(--n700);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Direction of what is typed (owner, 2026-11-12). A CR, VAT, member ID, phone, IBAN, date or birth year, and the
   company's English name, keep LEFT-TO-RIGHT READING ORDER — 7001599450 or "Al Noor Trading Co (KSA)" never flips —
   but are ALIGNED TO THE PAGE'S START, like their label: right on an Arabic page, left on an English one. Placeholders
   follow (unicode-bidi: plaintext lets an Arabic placeholder read right to left). One rule for every Medical field:
   the popup, the wizard and its drawers. :not(#otp-code) matches the weight of wizard.css's own rule, which
   left-aligns numeric inputs on Arabic pages for every product. */
.medical-flow :is(input[data-numeric], input[data-english-only], input[dir="ltr"], input[inputmode="numeric"],
                  input.seamless-input, input.endo-fld),
.ammn-wizard:has(.medical-flow) .drawer :is(input[data-numeric], input[dir="ltr"], input[inputmode="numeric"]) {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
}

[dir="rtl"] .medical-flow :is(input[data-numeric], input[data-english-only], input[dir="ltr"], input[inputmode="numeric"],
                              input.seamless-input, input.endo-fld):not(#otp-code),
[dir="rtl"] .ammn-wizard:has(.medical-flow) .drawer :is(input[data-numeric], input[dir="ltr"], input[inputmode="numeric"]):not(#otp-code) {
  text-align: right;
}

/* A shown date ("13-11-2026") keeps its order; the field still lays it out at the page's start. */
.medical-flow .ibs-date__text,
.ammn-wizard:has(.medical-flow) .drawer .ibs-date__text {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .medical-flow .ibs-date__text,
[dir="rtl"] .ammn-wizard:has(.medical-flow) .drawer .ibs-date__text {
  text-align: right;
}

/* The English name's 60-character cap is shown as it fills ("12 / 60"); the other counters stay hidden (above). */
.medical-flow .medical-name-en .mud-input-helper-text > .ms-auto {
  display: block;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.medical-flow .company-edit-count {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--n300);
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* What to type, under a field (the VAT number: 15 digits, 3…3, not the CR); while the value is wrong, the wizard's own
   .field-error line takes the hint's place and the field's border turns the error colour. */
.medical-flow .medical-field__hint {
  margin: 6px 4px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--n400);
}

/* IbsInputText paints its border from --wf-* tokens (ibs-style.css), so the tokens are re-pointed, not the border. */
.medical-flow .medical-field--error .mud-input.mud-input-outlined {
  --wf-border-default: var(--error);
  --wf-border-hover: var(--error);
  --wf-border-focus: var(--error);
}

.medical-flow .medical-field--error label.mud-input-label {
  color: var(--error);
}

/* Step 2's last fields — annual revenue, VAT registered, the tax number — each on a full-width row of its own at every
   width (owner, 2026-11-12). The VAT Yes / No are two equal halves of the row. */
.medical-flow .medical-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.medical-flow .medical-stack > *,
.medical-flow .medical-stack .ibs-ddl,
.medical-flow .medical-stack .ibs-btn-collections {
  width: 100%;
  max-width: none;
}

.medical-flow .medical-stack .ibs-bool-field {
  padding-bottom: 0;
}

.medical-flow .medical-stack .ibs-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
}

/* Step 2's two-column rows never stacked: on a phone the Arabic name was cut to "الشركة الو" and the
   start date's label wrapped over its own value. */
@media (max-width: 680px) {
  .medical-flow .row-8-4 {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

/* The CCHI notice wore a 4px coloured stripe down one side. A tinted panel with a hairline says
   "information" without the stripe. */
.medical-flow .cchi-banner {
  border: 1px solid var(--brand-blue-border);
  border-inline-start-width: 1px;
  background: var(--brand-blue-bg);
  box-shadow: none;
  color: var(--n700);
  font-size: 14px;
  line-height: 1.6;
}

.medical-flow .cchi-banner__title {
  color: var(--brand-blue-dark);
}

.medical-flow .cchi-stat__label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

/* The company card's member counter was a bare number; it now carries its word. */
.medical-flow .emp-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.medical-flow .emp-counter__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.medical-flow .company-meta bdi {
  font-variant-numeric: tabular-nums;
}

/* The 250-member line sat on the table's edge with no inset ("تغطي" touched the border). */
.medical-flow #member-limit-hint {
  margin: 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--n400);
  border-top: 1px solid var(--n70);
}

.medical-flow #member-limit-count {
  display: inline-block;
  white-space: nowrap;
  margin-inline-start: 6px;
  color: var(--n800);
  font-variant-numeric: tabular-nums;
}

/* The limit's reason, right under the (disabled) Add button it explains. */
.medical-flow #member-limit-reached {
  margin: 8px 0 0;
  padding: 0;
}

/* "Add employee" spans the member area at every width (owner, 2026-11-12), on both member screens. On the new-policy
   screen the actions take their own row under the section title, Add first; "download all declarations" follows,
   also full width. At the limit it is the neutral disabled pill above, with the reason under it. */
.medical-flow .page-employees .emp-header-row {
  flex-wrap: wrap;
  row-gap: 12px;
}

.medical-flow .page-employees .emp-header-actions {
  flex: 1 1 100%;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 10px;
}

.medical-flow .page-employees .emp-header-actions .ibs-btn {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

/* The endorsement screen's "add an employee (detailed)" is the footer row's first button: a full-width row of its
   own, in the page accent so it reads as the main way to add. */
.medical-flow .endo-footrow > .endo-btn-add:first-child {
  flex: 1 1 100%;
  justify-content: center;
  min-height: 48px;
  border-color: var(--page-accent);
  color: var(--page-accent-dark);
  font-size: 0.95rem;
}

.medical-flow .endo-footrow > .endo-btn-add:first-child svg {
  stroke: var(--page-accent);
}

.medical-flow .endo-footrow > .endo-btn-add:first-child:disabled {
  cursor: not-allowed;
}

.medical-flow .endo-footrow > .endo-btn-add:first-child:disabled svg {
  stroke: var(--n500);
}

/* The quick-add row's birth-year list opens below the row (UAT round 2). The card clipped its content (.card is
   overflow: hidden), so with no member yet only the list's search box showed, at 375px only its first year, and focusing
   that search box scrolled the card sideways. While a list is open the card lets it out, as the endorsement card does
   (wizard.css, .endo-card:has(.ibs-ddl--open)). */
.ammn-wizard .medical-flow .card.member-entry:has(.ibs-ddl--open) {
  overflow: visible;
}

/* The members table (owner, 2026-11-12): chevron, NAME, RELATION, PHONE, CLASS, BIRTH YEAR, AGE, actions. The name
   takes every pixel left over and wraps rather than being cut; the relation fits its longest word ("Dependent",
   "Daughter", "تابع") on one line; the phone and the birth year show all ten digits and a four-digit Hijri year, in the
   quick-add row's inputs too; the age fits "100 سنة" / "100 yrs" on one line; the class is the compact select
   (ClassButtonGroup Compact), so nine classes take one line. The age column's room comes from the members step's
   wider page (below) and a trimmed chevron and class select, not from the requested columns. Below 900px wizard.css
   stacks each member into one block, each value labelled (data-label). */
/* The page's side padding (80px) capped it near 1100px whatever its own width: on a wide screen the members step uses
   a narrower gutter, so the table gains the room for the age and relation columns. */
@media (min-width: 1101px) {
  .ammn-wizard .main:has(.medical-flow .page-employees) {
    padding-inline: 24px;
  }
}

.medical-flow .page-employees > .container {
  max-width: 1240px;
}

/* The chevron fits its trimmed 24px track (a touch screen keeps its 44px target, set below). */
.medical-flow .emp-table .emp-chevron {
  width: 24px;
}

.medical-flow :is(.emp-table-header, .emp-table-row, .emp-dep-row, .emp-dep-add-row) {
  grid-template-columns: 24px minmax(0, 1fr) 168px 124px 112px 116px 92px 128px;
  column-gap: 10px;
}

@media (min-width: 901px) and (max-width: 1100px) {
  .medical-flow :is(.emp-table-header, .emp-table-row, .emp-dep-row, .emp-dep-add-row) {
    grid-template-columns: 22px minmax(0, 1fr) 140px 112px 104px 100px 84px 104px;
    column-gap: 6px;
  }
}

/* The quick-add rows' ID box shows its whole placeholder ("ID Number (10 digits)"), cut at 130px before. */
.medical-flow .emp-add-idcell .seamless-input--id {
  flex: 1 1 100%;
  max-width: 280px;
}

/* Each cell's control fills its track: the phone input, the class select, the year picker. */
.medical-flow :is(.emp-cell-phone, .emp-cell-class, .emp-cell-year) {
  min-width: 0;
}

.medical-flow :is(.emp-cell-phone, .emp-cell-year) .seamless-input,
.medical-flow .emp-cell-year .ibs-birth-ym--compact {
  width: 100%;
  flex: 1 1 auto;
}

/* The shown phone, birth year and age keep their digits' order and sit at the page's start (right on an Arabic
   page). The age never wraps ("100 سنة" on one line). */
.medical-flow :is(.emp-cell-phone, .emp-cell-year, .emp-cell-age) {
  text-align: left;
}

[dir="rtl"] .medical-flow :is(.emp-cell-phone, .emp-cell-year, .emp-cell-age) {
  text-align: right;
}

.medical-flow .emp-cell-age {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.medical-flow .emp-cell-year .ibs-ddl__value {
  direction: ltr;
  unicode-bidi: plaintext;
  font-size: 14px;
  white-space: nowrap;
}

/* The relation: the whole label in its chip, never cut. "Dependent — pending check" may take two lines, broken
   between words only. */
.medical-flow :is(.emp-cell-rel, .endo-rel) .member-rel {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.35;
}

/* The dependents count, under the name with the check status. */
.medical-flow .emp-row-deps {
  font-size: 13px;
  font-weight: 600;
  color: var(--n600);
}

/* In the stacked layout each member is its own block, so the column header would read as a jumble of words with no
   row under them; and the add row's ID box would keep its 130px desktop width and cut its own placeholder. */
@media (max-width: 900px) {
  .medical-flow .emp-table-header {
    display: none;
  }

  .medical-flow .emp-add-idcell .seamless-input--id {
    flex: 1 1 100%;
  }
}

.medical-flow .emp-row-name strong,
.medical-flow .emp-row-name-en {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.medical-flow .endo-nm {
  overflow-wrap: anywhere;
}

.medical-flow .class-badge {
  min-width: 52px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

/* The relation (employee, spouse, son, daughter…) was a fixed 90px cell: long relation names wrapped into it. It now
   has 168px, as the members step's column (owner, 2026-11-12, asked three times); the name column gives way. A long
   label ("Dependent — pending check") breaks between words, never inside one. */
.medical-flow .endo-rel {
  flex: 0 0 168px;
  width: 168px;
  min-width: 168px;
  font-size: 0.85rem;
}

/* The endorsement rows' class badge gets the same room as a column of its own. */
.medical-flow .endo-row > .class-badge {
  flex: 0 0 auto;
  min-width: 64px;
}

/* Class picker and row actions: 23px pills and 28–32px icons are too small to tap. Desktop keeps a
   compact 32px; a touch screen gets the 44px target. */
.medical-flow .emp-action-btn,
.medical-flow .company-edit-btn {
  min-width: 36px;
  min-height: 36px;
}

@media (pointer: coarse) {
  .medical-flow .class-btn,
  .ammn-wizard:has(.medical-flow) .drawer .class-btn,
  .medical-flow .emp-action-btn,
  .medical-flow .emp-chevron,
  .medical-flow .company-edit-btn,
  .medical-flow .endo-icon,
  .medical-flow .endo-frozen,
  .medical-flow .endo-btn-ghost,
  .medical-flow .endo-btn-primary,
  .medical-flow .endo-btn-text,
  .medical-flow .endo-btn-add {
    min-height: 44px;
    min-width: 44px;
  }

  .medical-flow .seamless-input,
  .medical-flow .endo-fld {
    min-height: 44px;
    font-size: 16px;
  }
}

/* Keyboard focus on every Medical control that draws its own box: one ring. (The hero's buttons sit on a dark photo
   and keep their light ring above; text inputs keep a tighter offset below.) */
.medical-flow :is(.class-btn, .class-select__input, .emp-action-btn, .emp-chevron, .company-edit-btn,
                  .endo-icon, .endo-btn-ghost, .endo-btn-primary, .endo-btn-text, .endo-btn-add,
                  .offer-action-btn, .pricing-info-link, .ibs-recapture__refresh, .wizard-terms__link,
                  .apd-modal__close, .ibs-btn-row .ibs-btn):focus-visible,
.ammn-wizard:has(.medical-flow) .drawer .class-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.medical-flow :is(.seamless-input, .endo-fld):focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
}

/* A rejected member's reason: the strip used raw reds and a 3px stripe; it is now the theme's error
   colour on a soft tint, the text dark enough to read. */
.medical-flow .member-error-detail {
  border-inline-start: 0;
  border-radius: var(--radius-sm);
  margin: 0 16px 10px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--error) 8%, var(--n0));
  font-size: 13px;
  line-height: 1.5;
}

.medical-flow .member-error-detail__text {
  color: color-mix(in srgb, var(--error) 70%, var(--n900));
}

/* Add-employee drawer (owner, 2026-11-12). The birth year — the employee's and each dependent's — is a full-width
   field like the ID and phone above it, not half a row. */
.ammn-wizard:has(.medical-flow) .drawer .ibs-birth-ym,
.ammn-wizard:has(.medical-flow) .drawer .ibs-birth-ym .row-2 > *,
.ammn-wizard:has(.medical-flow) .drawer .ibs-birth-ym .ibs-ddl {
  width: 100%;
  flex: 1 1 100%;
}

/* One footer pattern in every Medical drawer: Save (the primary) spans the action area, Cancel spans it under Save. */
.ammn-wizard:has(.medical-flow) .drawer-footer .ibs-btn-row {
  flex: 1 1 100%;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 10px;
  margin-top: 0;
}

.ammn-wizard:has(.medical-flow) .drawer-footer .ibs-btn-row .ibs-btn {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

/* While a drawer is open on a phone, the floating chat button sat on top of the drawer's own
   "Add employee" button. It steps aside until the drawer closes. */
@media (max-width: 768px) {
  .ammn-wizard:has(.medical-flow):has(.drawer.open) .chatbot-fab {
    display: none;
  }
}

/* On a phone the chat button also covered the end of the full-width Next / Back buttons whenever they scrolled past
   it (QA, 2026-11-12). js/medical-flow.js marks it .chatbot-fab--aside while the two meet; it steps aside until the
   action bar has passed. */
.ammn-wizard:has(.medical-flow) .chatbot-fab.chatbot-fab--aside {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* The add-employee drawer's "save without dependents?" question: in the footer, in place of Save / Cancel, its
   "Yes, continue" full width on top as Save was, "Go back" under it. */
.ammn-wizard:has(.medical-flow) .drawer-footer .member-drawer__confirm {
  width: 100%;
}

.ammn-wizard:has(.medical-flow) .drawer-footer .member-drawer__confirm:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.ammn-wizard:has(.medical-flow) .drawer-footer .member-drawer__confirm .confirm-banner__body {
  flex: 1 1 auto;
  min-width: 0;
}

.ammn-wizard:has(.medical-flow) .drawer-footer .member-drawer__confirm .confirm-banner__actions {
  flex-direction: column-reverse;
  align-items: stretch;
}

.ammn-wizard:has(.medical-flow) .drawer-footer .member-drawer__confirm .confirm-banner__actions .ibs-btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}


/* ── Member entry (owner, 2026-11-12: "not clear for the user") ─────────────────────────────────────────────────
   Top to bottom: the guide (who to add, what each person needs, the Elm check, the class levels), the two ways to
   add in numbered boxes (one at a time | Excel), then the list with its member count. Shared by the members step
   and the endorsement screen (MemberEntryGuide). */
.medical-flow .member-guide {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--n100);
  border-radius: var(--radius-md);
  background: var(--n10);
}

.medical-flow .endo-card > .member-guide {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

.medical-flow .member-guide__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--n800);
}

.medical-flow .member-guide__lead,
.medical-flow .member-guide__needs {
  font-size: 14px;
  line-height: 1.6;
  color: var(--n700);
}

.medical-flow .member-guide__lead {
  margin: 0 0 12px;
}

.medical-flow .member-guide__needs-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--n800);
}

.medical-flow .member-guide__needs {
  margin: 0 0 12px;
  padding-inline-start: 20px;
}

.medical-flow .member-guide__needs li + li {
  margin-top: 4px;
}

/* The automatic Elm check, as a calm note: nothing for the customer to do. */
.medical-flow .member-guide__note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--n0));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--success) 8%, var(--n0));
  font-size: 13px;
  line-height: 1.5;
  color: var(--n700);
}

/* The class legend: the same coloured badges the list uses, highest cover first. */
.medical-flow .member-guide__classes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.medical-flow .member-guide__classes-label {
  margin-inline-end: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--n600);
}

.medical-flow .member-guide .class-badge {
  padding: 4px 12px;
  font-size: 13px;
}

/* The two ways, side by side on a wide screen and stacked on a phone, with "or" between them. */
.medical-flow .member-ways {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 24px;
}

.medical-flow .member-way,
.medical-flow .member-way.excel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1.5px solid var(--n200);
  border-radius: 12px;
  background: var(--n0);
}

.medical-flow .member-way__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--n800);
}

.medical-flow .member-way__num,
.ammn-wizard:has(.medical-flow) .drawer .member-step__num {
  display: inline-flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 50%;
  background: var(--page-accent);
  color: var(--n0);
  font-size: 14px;
  font-weight: 700;
}

.medical-flow .member-way__desc,
.medical-flow .member-way .excel-section-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--n600);
}

/* The Add button sits at the foot of its box, level with the Excel box's upload area. */
.medical-flow .page-employees .member-way .emp-header-actions {
  flex: 0 0 auto;
  margin-top: auto;
}

.medical-flow .member-way .excel-steps-row {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.medical-flow .member-way .excel-step-body {
  flex: 1 1 auto;
  min-width: 0;
}

/* The template's own sub-steps (download, then upload): readable, quieter than the way's number. */
.medical-flow .member-way .excel-step-num {
  background: var(--n100);
  color: var(--n700);
}

.medical-flow .member-way :is(.excel-download-btn, .excel-upload-area) {
  align-self: stretch;
  justify-content: center;
  min-height: 44px;
}

.medical-flow .member-ways__or {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--n500);
}

.medical-flow .member-ways__or span {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--n100);
}

@media (max-width: 900px) {
  .medical-flow .member-ways {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The list's title with the member count beside it. */
.medical-flow .member-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--n100);
}

.medical-flow .member-list-head .emp-section-title,
.medical-flow .member-list-head .my-vehicles__hint {
  margin: 0;
}

.medical-flow .page-employees .member-list-head ~ .emp-table {
  margin-top: 0;
}

/* Beside the title the count needs none of the inset and rule it has at the endorsement card's foot. */
.medical-flow .member-list-head #member-limit-hint {
  padding: 0;
  border-top: 0;
}

/* Nothing added yet: a dashed box that says what to do first, never a blank table. */
.medical-flow .emp-empty-state {
  padding: 28px 20px;
  border: 1.5px dashed var(--n200);
  border-radius: 12px;
  color: var(--n400);
}

.medical-flow .emp-empty-state p {
  font-size: 16px;
  color: var(--n800);
}

.medical-flow .emp-empty-state span {
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--n600);
}

.medical-flow .emp-quick-add-caption {
  margin: 0;
  padding: 16px 16px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--n600);
}

/* Under each name: who the person is (employee or dependent) and their check status, in words. */
.medical-flow .emp-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.medical-flow .member-rel {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--n100);
  font-size: 13px;
  font-weight: 600;
  color: var(--n700);
}

.medical-flow .member-rel--dep {
  background: color-mix(in srgb, var(--brand-blue) 10%, var(--n0));
  color: var(--brand-blue-dark);
}

.medical-flow .emp-row-meta .verify-badge {
  gap: 4px;
  margin-inline-start: 0;
  font-size: 13px;
  font-weight: 600;
}

/* On a phone the column headers are hidden, so each value says what it is ("Phone: 05…", "Birth year: 1405"). */
@media (max-width: 900px) {
  .medical-flow :is(.emp-table-row, .emp-dep-row) > [data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--n500);
  }
}

.medical-flow .verify-badge--fail {
  color: var(--error);
}

.medical-flow .verify-badge--new {
  color: var(--n500);
}

/* "Needs attention" is never a dead end: the next step follows the reason, on its own line. */
.medical-flow .member-error-detail__next {
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--n700);
}

.medical-flow .endo-ways-caption {
  margin: 12px 18px 0;
}

/* The add-employee drawer: three numbered steps, each field with its example under it. */
.ammn-wizard:has(.medical-flow) .drawer .member-drawer__intro {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--n600);
}

.ammn-wizard:has(.medical-flow) .drawer .member-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--n100);
}

.ammn-wizard:has(.medical-flow) .drawer .member-step:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.ammn-wizard:has(.medical-flow) .drawer .member-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--n800);
}

.ammn-wizard:has(.medical-flow) .drawer .medical-field__hint {
  margin: 0 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--n500);
}

/* A dependent's ID on its own row and the class under it: side by side, the five class buttons wrapped. */
.ammn-wizard:has(.medical-flow) .drawer .member-step--optional .row-2 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

/* The example sits right under its field, not a section gap (20px) away from it. */
.ammn-wizard:has(.medical-flow) .drawer .drawer-section > :is(.ibs-input, .ibs-birth-ym) + .medical-field__hint {
  margin-top: -14px;
}

.ammn-wizard:has(.medical-flow) .drawer .member-drawer__after-save {
  margin-top: 12px;
}

/* ── The insurance-class picker (owner, 2026-11-12: "the class buttons are not clear"; all nine classes) ──────────
   Nine classes, lowest to highest, each by its localized name. The drawer shows them as a grid of labelled buttons: 3
   across in a phone's drawer, 5 across when the drawer is wider. An unselected class is calm (white, a coloured
   underline naming its class colour); the chosen one is filled with its class colour, darkened toward --n900 so white
   text reads on every class (the amber A and the cyan C included), and carries a check mark — never colour alone. A
   "+" class shares its base class's colour and wears a double border. The table rows use the compact select instead,
   tinted with the chosen class's colour. */
.medical-flow .member-step,
.ammn-wizard:has(.medical-flow) .drawer .member-step {
  container-type: inline-size;
}

.medical-flow .class-picker,
.ammn-wizard:has(.medical-flow) .drawer .class-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

@container (min-width: 420px) {
  .medical-flow .class-picker,
  .ammn-wizard:has(.medical-flow) .drawer .class-picker {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.medical-flow .class-picker .class-btn,
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border: 1.5px solid var(--n200);
  border-radius: 10px;
  background: var(--n0);
  box-shadow: inset 0 -3px 0 var(--_cls);
  color: var(--n800);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.medical-flow .class-picker .class-btn:hover:not(:disabled),
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn:hover:not(:disabled) {
  border-color: var(--_cls);
}

.medical-flow .class-picker .class-btn--plus,
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn--plus {
  border: 3px double var(--n300);
  padding: 4px 8px;
}

.medical-flow .class-picker .class-btn.class-btn--active,
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn.class-btn--active {
  border-color: color-mix(in srgb, var(--_cls) 72%, var(--n900));
  background: color-mix(in srgb, var(--_cls) 72%, var(--n900));
  box-shadow: none;
  color: var(--n0);
  font-weight: 700;
}

.medical-flow .class-picker .class-btn--plus.class-btn--active,
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn--plus.class-btn--active {
  border-color: var(--n0);
}

.medical-flow .class-picker .class-btn:disabled,
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn:disabled {
  cursor: not-allowed;
  border-color: var(--n200);
  background: var(--n50);
  box-shadow: none;
  color: var(--n600);
}

.medical-flow .class-picker .class-btn__check,
.ammn-wizard:has(.medical-flow) .drawer .class-picker .class-btn__check {
  flex: 0 0 auto;
}

/* The compact select: the chosen class's tint and colour edge, its name in bold. */
.medical-flow .class-select--basic { --_cls: var(--class-basic); --_cls-bg: var(--class-basic-bg); }
.medical-flow .class-select--c { --_cls: var(--class-c); --_cls-bg: var(--class-c-bg); }
.medical-flow .class-select--b { --_cls: var(--class-b); --_cls-bg: var(--class-b-bg); }
.medical-flow .class-select--a { --_cls: var(--class-a); --_cls-bg: var(--class-a-bg); }
.medical-flow .class-select--vib { --_cls: var(--class-vib); --_cls-bg: var(--class-vib-bg); }

.medical-flow .class-select {
  display: inline-flex;
  width: 100%;
  max-width: 180px;
}

.medical-flow .class-select__input {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: 1.5px solid var(--_cls, var(--n200));
  border-radius: 10px;
  background: var(--_cls-bg, var(--n0));
  color: var(--n800);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.medical-flow .class-select--plus .class-select__input {
  border: 3px double var(--_cls);
  padding: 4px 6px;
}

.medical-flow .class-select__input:disabled {
  cursor: not-allowed;
  border-color: var(--n200);
  background: var(--n50);
  color: var(--n600);
}

@media (pointer: coarse) {
  .medical-flow .class-select__input {
    min-height: 44px;
  }
}

/* A class name reads in its own direction: "A+" keeps its "+" after the A on an Arabic page (a neutral "+" at the end
   of a Latin name otherwise jumps to the front), while "أساسي" stays right to left. */
.medical-flow :is(.class-badge, .class-btn__label, .class-select__input, .class-select__input option),
.ammn-wizard:has(.medical-flow) .drawer :is(.class-badge, .class-btn__label) {
  unicode-bidi: plaintext;
}

/* The table's quick-add inputs at the readable 14px. */
.medical-flow .emp-table .seamless-input {
  font-size: 14px;
}

/* A "+" class chip: the base class's colour with a ring, beside its "+" name. */
.medical-flow .class-badge--plus,
.ammn-wizard:has(.medical-flow) .drawer .class-badge--plus {
  box-shadow: inset 0 0 0 2px var(--_cls);
  font-weight: 800;
}

/* The endorsement add row: the phone shows all ten digits, the year its four. */
.medical-flow .endo-addrow .endo-fld--phone {
  width: 140px;
  font-size: 14px;
}

.medical-flow .endo-addrow .ibs-birth-ym--compact {
  flex: 0 0 132px;
}

.medical-flow .endo-addrow .class-select,
.medical-flow .endo-addform .class-select {
  width: 140px;
}

/* ----------------------------------------------------------------
   4. ACTIVE-POLICY DECISION DIALOG
   ---------------------------------------------------------------- */

.medical-flow .apd-modal__card {
  background: var(--n0);
  box-shadow: var(--shadow-lg);
}

.medical-flow .apd-modal__close {
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  top: 8px;
  inset-inline-end: 8px;
  border-radius: var(--radius-full);
}

.medical-flow .apd-policy__dates {
  font-variant-numeric: tabular-nums;
}

/* "Not active yet" is a wait, not a green light: the badge takes the warning colour. */
.medical-flow .apd-policy__badge--waiting {
  background: color-mix(in srgb, var(--amber) 14%, var(--n0));
  color: color-mix(in srgb, var(--amber) 70%, var(--n900));
}

.medical-flow .apd-policy__expiry {
  color: color-mix(in srgb, var(--amber) 70%, var(--n900));
}

.medical-flow .apd-modal__prompt {
  color: var(--n600);
}

/* One action, full width on a phone, where a small corner button is easy to miss. */
@media (max-width: 560px) {
  .medical-flow .apd-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .medical-flow .apd-modal__card {
    padding: 24px 20px 20px;
  }

  .medical-flow .apd-modal__actions .ibs-btn {
    width: 100%;
  }
}


/* ----------------------------------------------------------------
   5. ENDORSEMENT — adding members to the live policy
   ---------------------------------------------------------------- */

/* Several labels ran at 9–11px (0.58–0.72rem): the "new" tag, the term label, the lock note, the hints.
   The smallest text on the page is now 12px. Section titles drop the letter-spaced capitals — Arabic
   has no capitals, and in English they read as shouting. */
.medical-flow .endo-section__title {
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
}

.medical-flow .endo-policy__lbl {
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--n300);
}

.medical-flow .endo-policy__val {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.medical-flow .endo-tag-new {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.medical-flow :is(.endo-lock, .endo-declared, .endo-verify, .endo-under, .endo-id, .endo-hint,
                  .endo-pill, .endo-addform__hint, .endo-upload-rowerr) {
  font-size: 0.78rem;
}

.medical-flow :is(.endo-id, .endo-under, .endo-lock, .endo-hint) {
  color: var(--n300);
}

.medical-flow .endo-id {
  font-variant-numeric: tabular-nums;
}

.medical-flow :is(.endo-btn-ghost, .endo-btn-add, .endo-btn-primary, .endo-btn-text) {
  font-size: 0.85rem;
  min-height: 36px;
}

.medical-flow :is(.endo-icon, .endo-frozen) {
  width: 36px;
  height: 36px;
}

.medical-flow .endo-fld {
  min-height: 36px;
  font-size: 0.875rem;
}

.medical-flow .endo-search {
  min-height: 36px;
}

.medical-flow .endo-search input {
  font-size: 0.875rem;
}

/* The search box pushed the section header past a phone's width; it takes its own line there. */
@media (max-width: 680px) {
  .medical-flow .endo-section__head {
    flex-wrap: wrap;
  }

  .medical-flow .endo-search {
    order: 3;
    flex: 1 1 100%;
    width: auto;
    margin-inline-start: 0;
  }

  .medical-flow .endo-policy {
    flex-wrap: wrap;
    gap: 12px;
  }

  .medical-flow .endo-policy__term {
    flex: 1 1 100%;
    text-align: start;
  }

  .medical-flow .endo-addform {
    padding-inline-start: 18px;
  }
}


/* ----------------------------------------------------------------
   6. OFFERS — the Medical quote card and the endorsement's insurer errors
   ---------------------------------------------------------------- */

/* "Pricing details" is a button now (it was a click-only <span>); it keeps the link look. */
.medical-flow button.pricing-info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* The member-pricing drawer's footer (DEF-083): the card's payable total, with the halalas the member prices leave over
   as their own line above it, and a short note on the insurer's rounding. */
.ammn-wizard:has(.medical-flow) .emp-pricing-drawer-footer {
  align-items: flex-start;
  gap: 16px;
}

.ammn-wizard:has(.medical-flow) .emp-pricing-footer-sum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}

.ammn-wizard:has(.medical-flow) .emp-pricing-footer-adjust {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--n500);
}

.ammn-wizard:has(.medical-flow) .emp-pricing-footer-note {
  max-width: 320px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--n400);
  text-align: end;
}

/* An endorsement asks only the policy's own insurer, so when it refuses, its card IS the answer.
   It was an unstyled 3rem-padded block with a faded 64px logo. Now: a card per insurer — logo,
   name, the insurer's own words, then the code and reference support needs. */
.medical-flow .offers-insurer-errors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  margin: 24px auto;
  text-align: center;
}

.medical-flow .offers-insurer-error {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
  width: 100%;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--error) 30%, var(--n40));
  border-radius: var(--radius-md);
  background: var(--n0);
  box-shadow: var(--shadow-sm);
  text-align: start;
}

.medical-flow .offers-insurer-error .ammn-error-state__icon {
  grid-row: 1 / span 3;
  width: 48px;
  height: 48px;
  object-fit: contain;
  opacity: 1;
  border-radius: var(--radius-sm);
  background: var(--n10);
}

.medical-flow .offers-insurer-error .ammn-error-state__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--n800);
}

.medical-flow .offers-insurer-error .ammn-error-state__message {
  max-width: none;
  opacity: 1;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--n600);
  overflow-wrap: anywhere;
}

.medical-flow .offers-insurer-error__ref {
  font-size: 0.78rem;
  color: var(--n300);
  font-variant-numeric: tabular-nums;
}

.medical-flow .offers-insurer-errors__retry {
  min-height: 44px;
  min-width: 200px;
  border-radius: var(--radius-full);
}


/* ----------------------------------------------------------------
   7. TEXT FLOORS — last in the sheet, so they win over the sizes set above
   ---------------------------------------------------------------- */

/* The step names and the request-number chip read as labels: 14px, keeping their own colours. */
.medical-flow :is(.medical-request-ref, .step-label, .emp-counter__label) {
  font-size: 14px;
}

/* Readable text across the Medical wizard, drawers and dialogs (owner, 2026-11-12: "not clear"). Floors: a field or
   column label 14px, a hint or helper 13px, an error 13px, in token colours that read on white. The shared sheets set
   these at 11-13px (0.72-0.82rem) for every product; on the Medical screens they are raised here. */
.medical-flow :is(.ibs-ddl__label, .ibs-date__label, .field-label, .emp-table-header > div, .cchi-stat__label,
                  .endo-policy__lbl, .apd-policy__meta),
.ammn-wizard:has(.medical-flow) .drawer :is(.ibs-ddl__label, .ibs-date__label, .field-label) {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--n600);
}

.medical-flow :is(.ibs-birth-ym__hint, .mud-input-helper-text, .emp-row-id, .emp-row-name-en, .company-vat-badge,
                  .company-size-badge, .company-edit-count, .excel-step-num, .excel-download-btn, .excel-upload-area,
                  .page-banner p, .banner-step, .step-num, .excel-section-desc,
                  .excel-step-body, .endo-lock, .endo-declared, .endo-verify, .endo-under, .endo-id, .endo-hint, .endo-pill,
                  .endo-addform__hint, .endo-tag-new, .offers-insurer-error__ref, .apd-policy__badge,
                  .ibs-recapture__error),
.ammn-wizard:has(.medical-flow) .drawer :is(.ibs-birth-ym__hint, .mud-input-helper-text) {
  font-size: 13px;
}

.medical-flow :is(.ibs-birth-ym__hint, .emp-row-id, .emp-row-name-en, .excel-section-desc, .endo-hint, .endo-under),
.ammn-wizard:has(.medical-flow) .drawer .ibs-birth-ym__hint {
  color: var(--n400);
}

.medical-flow :is(.field-error, .ibs-date__error, .ibs-ddl__error, .endo-fielderr, .endo-upload-rowerr,
                  .member-error-detail, .member-error-detail__text),
.ammn-wizard:has(.medical-flow) .drawer :is(.field-error, .ibs-date__error, .ibs-ddl__error) {
  font-size: 13px;
  line-height: 1.5;
}
