/* AdLabDraft controls (W-ADLABSTIL-1511): one rule set for the form controls of the AdLab / Planner page.
   Select arrow (same inset on every select, theme-aware), selected-platform dot ring, 44 px stepper touch targets,
   keyboard focus ring. Loaded after draft.css; selectors are specific enough to win by specificity alone. Tokens only. */

/* every select: native arrow off, one caret drawn from the ink token, same distance from the edge everywhere */
main select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

/* keyboard focus is clearly visible; a mouse click leaves no coloured edge */
main select:focus:not(:focus-visible),
main .k-stp input:focus:not(:focus-visible) {
  outline: none;
}
main select:focus-visible,
main .k-stp input:focus-visible,
main .k-stp button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* selected platform / segment button: the brand dot gets a white ring and more room so it never melts into the blue */
main #pfs button.on .pd,
main .pfs button.on .pd,
main .rs > button.on .pd {
  outline: 2px solid var(--adl-white);
  outline-offset: 0;
}
main #pfs button,
main .pfs button,
main .rs > button {
  gap: 10px;
}

/* number steppers: 44 px touch targets, one look everywhere */
main .k-stp {
  min-height: 44px;
}
main .k-stp button:is(:first-child, :last-child) {
  width: 44px;
  flex: none;
}

/* Shopify row: items wrap instead of overlapping */
main .k-shp {
  gap: 10px 12px;
}
main .k-shp > *,
main .k-shpr > * {
  flex: none;
  min-width: 0;
}

/* offer comparison table: the best row stands out with a brand stripe; on a phone every row becomes a card (no sideways scroll) */
main #kOt tr.best td:first-child {
  box-shadow: inset 5px 0 0 var(--brand);
}
@media (max-width: 640px) {
  main #kOt,
  main #kOt tbody {
    display: block;
  }
  main #kOt tr.k-oth {
    display: none;
  }
  main #kOt tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin: 0 0 12px;
    padding: 12px;
    border: 2px solid var(--k);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 3px 3px 0 var(--k);
  }
  main #kOt tr.best {
    background: var(--brand-50);
    box-shadow: 3px 3px 0 var(--brand);
  }
  main #kOt td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    white-space: normal;
  }
  main #kOt tr.best td:first-child {
    box-shadow: none;
  }
  main #kOt td:first-child {
    grid-column: 1 / -1;
    width: auto;
    font: 800 14px/1.4 Inter,'Inter Fallback';
  }
  main #kOt td[data-l]::before {
    content: attr(data-l);
    display: block;
    font: 700 11px/1.3 Inter,'Inter Fallback';
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  main #kOt tr.k-otm {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

/* touch targets: on a phone or any coarse pointer every tappable control is at least 44 x 44 px (W-ADLABSTIL-1511).
   Chips, tabs, segment buttons, feedback buttons, steppers, selects, sliders and checkbox rows share one floor; links inside a sentence are the only exception. */
@media (max-width: 640px), (pointer: coarse) {
  main :is(button, summary, select, input:not([type="checkbox"], [type="radio"]), [role="button"]) {
    min-height: 44px;
  }
  main :is(.k-fbs button, .k-stp button, .k-stp input) {
    min-width: 44px;
  }
  main label:has(> input[type="checkbox"], > input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
  }
  main .split .spc label {
    flex-wrap: wrap;
  }
  main .k-stp {
    max-width: 100%;
  }
  main :is(.k-tchips .k-chip, .k-otm .k-btn) {
    min-height: 44px;
  }
  main :is(#learn, .note, .bnote) a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* info / result box: fills the width of its container and so does its text (W-START-KAYNAK-1711); a box with no content is not drawn (0 px, no reserved space) */
main .k-tip {
  max-inline-size: none;
}
main .k-tip:empty,
main .k-fbw:empty {
  display: none;
}

/* step rating card (W33-1511): the same filled card as the other cards (solid line, paper fill), no dashed frame; stars are outlined ink until chosen, gold once chosen */
main .k-fb {
  border-style: solid;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--k);
}
main .k-fbs button {
  color: var(--paper);
  -webkit-text-stroke: 1.5px var(--ink);
}
main .k-fbs button:hover {
  color: var(--adl-c-f5b823);
}
main .k-fbs button.on {
  color: var(--adl-c-f5b823);
  -webkit-text-stroke: 1.5px var(--adl-c-0b0d14);
}

/* ── W39b-1511 · fields, selects and ticks are the DS .as-input / .as-select / .as-check; this block only sets the page's size and layout ──
   Page rules stay layout only (width, flex, max-width); colour, border, radius, padding and font come from the DS classes.
   :where(main) keeps the page default one step below any layout rule that sets a width, so a context can still narrow a field. */
:where(main) .as-input,
:where(main) .as-select {
  min-block-size: var(--h-touch);
  font-family: inherit;
  font-size: var(--type-site-body);
  font-weight: var(--w-semibold);
  color: var(--ink);
}
:where(main) .as-input {
  inline-size: 100%;
}

/* number inside a stepper: the stepper draws the frame, the field is bare, centred, no spin buttons, no coloured ring on a mouse click */
main .k-stp .as-input {
  min-block-size: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
  margin: 0;
  padding-inline: 0;
}
/* a number must be readable in its stepper (W1-2511). The DS field keeps 12 px of padding on each side; inside a stepper the number box is as narrow as 24-48 px,
   so the padding took the whole room and the value, although set, was not drawn (the goal steppers on the metric tiles showed "- [ ] +"). The bare field has no padding.
   The goal steppers sit on a tile about 118 px wide: with a mouse their buttons are the smallest target size (24 px) and the number is the row size (14 px), so four characters fit;
   on touch the 44 px targets stay (the tiles are wider there). */
main #tiles .kin .as-input {
  font-size: var(--type-row);
}
@media (min-width: 641px) and (pointer: fine) {
  main #tiles .kin .k-stp button:is(:first-child, :last-child) {
    width: var(--target-min);
  }
}
main .k-stp .as-input::-webkit-outer-spin-button,
main .k-stp .as-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
main .k-stp .as-input:focus {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}
main .k-stp .as-input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* the select that has its list open (Goal picker pop-over) keeps a brand ring */
main .as-select.gopen {
  box-shadow: 0 0 0 var(--focus-ring-spread) var(--brand-soft);
  border-color: var(--brand-ink);
}

/* cards in one grid row end on the same line (offer-type cards, own-numbers cards) */
main :is(.k-oftypes, .dr-own) {
  align-items: stretch;
}

/* spacing and type helpers that replace one-off inline style on the page (tokens, one name per use) */
main .adl-mt-0 { margin-top: 0; }
main .adl-mt-8 { margin-top: var(--space-8); }
main .adl-mt-10 { margin-top: var(--space-10); }
main .adl-mt-12 { margin-top: var(--space-12); }
main .adl-mt-14 { margin-top: var(--space-14); }
main .adl-mt-16 { margin-top: var(--space-16); }
main .adl-mt-22 { margin-top: var(--space-22); }
main .adl-mtz-2 { margin: var(--space-2) 0 0; }
main .adl-mtz-6 { margin: var(--space-6) 0 0; }
main .adl-mtz-8 { margin: var(--space-8) 0 0; }
main .adl-mtz-10 { margin: var(--space-10) 0 0; }
main .adl-mb-10 { margin: 0 0 var(--space-10); }
main .adl-my-6 { margin: var(--space-6) 0; }
main .adl-m-0 { margin: 0; }
main .adl-gap-10 { gap: var(--space-10); }
main .adl-ink { color: var(--ink); }
main .adl-ink-2 { color: var(--ink-2); }
main .adl-ink-3 { color: var(--ink-3); }
main .adl-fs-14 { font-size: var(--type-site-nav); }
main .adl-fs-15 { font-size: var(--type-site-callout); }
main .adl-fs-chip { font-size: var(--type-chip); }
main .adl-lead-b { font-size: var(--type-title); font-weight: 700; }
main .adl-meta { font-size: var(--type-row); color: var(--ink-2); }
main .adl-plan-h { font: 700 22px var(--gs); margin: var(--space-4) 0; }
main .adl-plain { font-style: normal; }
main .adl-scroll-x { overflow-x: auto; }
main .adl-col-fill { display: flex; flex-direction: column; gap: var(--space-14); height: 100%; }

/* sign-in gate card (W39-1511): the two inline styles of the locked-step card live here; the key mark is the headline size, the Google button centres itself */
main .k-gate__ico {
  font-size: var(--type-headline);
}
main .k-gate .k-gate__btn {
  margin: 0 auto;
}

/* DS control tokens on the AdLab page (W1-2511). The DS form components (.as-check, .as-input, .as-select) read the DS colour tokens, and those are
   declared under .as-web; the AdLab course body is not inside that scope (its own palette lives on :root), so each of them resolved to nothing here:
   a tick box had no edge while empty and no tick line while checked. The page hands the DS names its own palette values (theme-aware, light and dark),
   so the DS components draw as written and no AdLab rule restyles them. Scope is the course body only; the site menu and footer keep their own. */
main {
  --card: var(--paper);
  --card-2: var(--fill);
  --line-ctl: var(--k);
  --sep-2: var(--line);
  --label: var(--ink);
  --label-2: var(--ink-2);
  --label-3: var(--ink-3);
  --on-brand: var(--adl-white);
  --brand-ink: var(--brand);
  --brand-soft: var(--brand-50);
  --focus-ring: var(--focus-w) solid var(--brand-ink);
}

/* AdLab game frame of EVERY text control (W-START-KAYNAK-1711, widens W32-1611): thick dark outline, paper fill, hard offset shadow, no blur.
   The DS .as-select / .as-input / .as-textarea frame is "border: hair solid var(--line-ctl)" on var(--card); the AdLab page defines neither
   token, so the whole shorthand was invalid and every such control drew no edge at all. One rule here frames them all in steps 0-9. */
main {
  --ctl-outline: calc(var(--border-hair) * 2);
  --ctl-shadow: calc(var(--border-hair) * 3);
}
main :is(.as-select, .as-input, .as-textarea) {
  border: var(--ctl-outline) solid var(--k);
  background-color: var(--paper);
  box-shadow: var(--ctl-shadow) var(--ctl-shadow) 0 var(--k);
  font-weight: var(--w-bold);
}
main :is(.as-select, .as-input, .as-textarea):focus-visible {
  box-shadow: var(--ctl-shadow) var(--ctl-shadow) 0 var(--brand);
}

/* ── W-CLS320-1711 · reserved height for Arabic and Chinese above the fold ──
   Their own web font (Noto Sans Arabic / Noto Sans SC) lays text out taller and in more lines than the system fallback it replaces.
   Each row below keeps the height of the loaded font from the first paint, so the late swap moves nothing. Latin languages need no
   reserve: the metric-matched Inter Fallback / Space Grotesk Fallback faces already match their size. Heights are the measured loaded rows. */
:lang(ar) .k-promo {
  min-block-size: 44px;
}
:lang(ar) main .kb-t {
  min-block-size: 33px;
}
:lang(ar) main .k-kick {
  min-block-size: 25px;
}
:lang(ar) main .k-sub {
  min-block-size: 48px;
}
:lang(ar) main #h1t {
  min-block-size: 47px;
}
:lang(zh) main #h1t {
  min-block-size: 50px;
}
:lang(ar) main .freebar {
  min-block-size: 44px;
}
:lang(zh) main .freebar {
  min-block-size: 35px;
}
@media (max-width: 900px) {
  :lang(ar) main .freebar {
    min-block-size: 77px;
  }
  :lang(zh) main .freebar {
    min-block-size: 60px;
  }
}
@media (max-width: 480px) {
  :lang(ar) main .k-brand {
    min-block-size: 110px;
  }
  :lang(ar) main #h1t {
    min-block-size: 65px;
  }
  :lang(zh) main #h1t {
    min-block-size: 65px;
  }
  :lang(ar) main .k-sub,
  :lang(zh) main .k-sub {
    min-block-size: 72px;
  }
  :lang(zh) main #kScen {
    min-block-size: 194px;
  }
}
@media (max-width: 340px) {
  :lang(ar) main #h1t {
    min-block-size: 98px;
  }
  :lang(ar) main .hero3 .lead {
    min-block-size: 45px;
  }
}
@media (min-width: 641px) {
  :lang(ar) main .k-tchips .k-chip {
    min-block-size: 42px;
  }
  :lang(ar) main .biz .bl {
    min-inline-size: 82px;
  }
  :lang(ar) main #bizT {
    min-inline-size: 227px;
  }
}
