/* Karen Marketing, Results tab (web/marketing-dashboard*.js). Tokens from styles.css :root only, no hard-coded colours, no red.
   Linked from index.html. The tab's frame (T8a) is at the bottom; later tasks add each section's own rules there. */

/* ---- Charts (T6: marketing-dashboard-chart.js) ----
   Each series class sets one colour; bars, lines, dots and legend keys all read it. Neighbouring series alternate hue (green, blue, amber,
   green, grey). Colour is never the only signal: every chart has a legend with words, stacked segments have a separator, the compare line
   is dashed, the marker is labelled, and every bar has a <title>. */
.mk-dash-s0 { --mk-dash-c: var(--green-900); }
.mk-dash-s1 { --mk-dash-c: var(--blue); }
.mk-dash-s2 { --mk-dash-c: var(--amber); }
.mk-dash-s3 { --mk-dash-c: var(--green-700); }
.mk-dash-s4 { --mk-dash-c: var(--muted); }  /* "Other" */
.mk-dash-cmp { --mk-dash-c: var(--grey-ink); }

.mk-dash-chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.mk-dash-chart .mk-dash-grid { stroke: var(--divider); stroke-width: 1; }
.mk-dash-chart .mk-dash-axis { stroke: var(--line); stroke-width: 1; }
.mk-dash-chart .mk-dash-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mk-dash-chart .mk-dash-bar { fill: var(--mk-dash-c); }
.mk-dash-stacked .mk-dash-bar { stroke: var(--surface); stroke-width: 2; }
.mk-dash-chart .mk-dash-line { fill: none; stroke: var(--mk-dash-c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mk-dash-chart .mk-dash-dot { fill: var(--mk-dash-c); stroke: var(--surface); stroke-width: 1.5; }
.mk-dash-chart .mk-dash-case { fill: none; stroke: var(--surface); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.mk-dash-chart path.mk-dash-cmp { fill: none; stroke: var(--mk-dash-c); stroke-width: 1.5; stroke-dasharray: 5 4; }
.mk-dash-chart circle.mk-dash-cmp { fill: var(--mk-dash-c); }
.mk-dash-chart .mk-dash-mark { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.mk-dash-chart .mk-dash-mark-text { fill: var(--ink); font-size: 11px; }

.mk-dash-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.mk-dash-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mk-dash-key { display: inline-block; flex: none; }
.mk-dash-key-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--mk-dash-c); }
.mk-dash-key-line { width: 16px; height: 0; border-top: 2px solid var(--mk-dash-c); }
.mk-dash-key-cmp { width: 16px; height: 0; border-top: 2px dashed var(--mk-dash-c); }

/* ---- The tab's frame (T8a: marketing-dashboard.js) ----
   The Results tab grows with the page (no inner scroll box), keeps to the 8/12/16 rhythm and never scrolls sideways: grid and flex
   children get min-width: 0, long text wraps, and wide tables scroll inside their own wrapper (.mk-dash-tw). */
.mk-tbl.mk-dash-box { max-height: none; overflow: visible; }

.mk-dash-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.mk-act .mk-dash-tools select { width: auto; max-width: 100%; }

.mk-dash { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 24px; min-width: 0; transition: opacity .15s; }
.mk-dash > * { min-width: 0; }
.mk-dash.mk-dash-busy { opacity: .6; }

.mk-dash-fresh { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.mk-dash-fresh > * { min-width: 0; overflow-wrap: anywhere; }
.mk-dash-fresh .dotw { white-space: normal; font-size: 13px; color: var(--grey-ink); }
.mk-dash-sofar { margin: -8px 0 0; font-size: 13px; color: var(--muted); }  /* sits just under the freshness line (T8b review) */

.mk-dash-sec { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--divider); min-width: 0; }
.mk-dash-sec > * { min-width: 0; }
.mk-dash-sec > h2.sechead { margin: 0; }
.mk-dash-empty { margin: 0; font-size: 14px; color: var(--muted); }

.mk-dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 12px; }
.mk-dash-tiles > * { min-width: 0; }
.mk-dash-fig { margin: 0; min-width: 0; }
.mk-dash-fig svg { display: block; width: 100%; height: auto; }
.mk-dash-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.mk-dash-tw { overflow-x: auto; min-width: 0; }
.mk-dash-wrap { overflow-wrap: anywhere; }

/* ---- Section 1, Search funnel (T8b) ----
   Three quiet tiles (label, figure, change), then the three charts side by side when there's room for each at about 340px, one under
   another on a phone. The change is plain text: colour is kept for things that are wrong. */
.mk-dash-tiles3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); max-width: 760px; }
.mk-dash-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.mk-dash-tl { font-size: 13px; color: var(--muted); }
.mk-dash-tv { font-size: 24px; font-weight: 800; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; }
.mk-dash-tc { font-size: 13px; color: var(--grey-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mk-dash-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px 24px; }
.mk-dash-figs > * { min-width: 0; }
.mk-dash-figs > .mk-dash-fig { display: flex; flex-direction: column; }
.mk-dash-figs .mk-dash-note { flex: 1 0 auto; }  /* the Figures folds line up across a row */
.mk-dash-figs .mk-dash-note-lead { flex: 0 0 auto; }  /* a second note line follows it and takes the stretch */
.mk-dash-cap { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.mk-dash-plot { min-width: 0; }
.mk-dash-ft { font-size: 13px; }
.mk-dash-ft th { height: 32px; padding: 0 10px; }
.mk-dash-ft td { padding: 6px 10px; }
.mk-dash-ft .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Fold summaries big enough to tap (44px) on touch screens and phones; beats styles.css details.fold > summary (40px) */
@media (pointer: coarse), (max-width: 720px) { .mk-dash details.fold > summary { min-height: 44px; } }

@media (max-width: 720px) {
  .mk-act .mk-dash-tools { width: 100%; }
  .mk-act .mk-dash-tools select { flex: 1 1 160px; }
  .mk-dash { gap: 12px; padding: 12px 12px 16px; }
  .mk-dash-sec { padding-top: 12px; }
  .mk-dash-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  /* The three Search funnel tiles stay on one row on a phone, a little smaller */
  .mk-dash-tiles3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mk-dash-tiles3 .mk-dash-tile { padding: 10px; }
  .mk-dash-tiles3 .mk-dash-tv { font-size: 20px; }
  .mk-dash-tiles3 .mk-dash-tl { flex: 1 0 auto; }  /* a two-line label pushes its figure down to line up with its neighbours */
}

/* ---- Section 2, Enquiries (T10) ----
   The lead-type ticks sit in one wrapping row above two quiet tiles; the stacked channel chart and the lead rate table share the
   .mk-dash-figs grid (side by side on a wide screen). The Lead types fold is a short list of rows that wrap on a phone: the event name,
   then the label, then "Counts as a lead", the order and Save. Checkbox labels and Save buttons are 44px tall on touch screens and phones. */
.mk-dash-leads { margin: 0; padding: 0; border: 0; min-width: 0; }
.mk-dash-lg { padding: 0; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.mk-dash-chks { display: flex; flex-wrap: wrap; gap: 0 20px; min-width: 0; }
.mk-dash-chk { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.mk-dash-tiles2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); max-width: 520px; }
.mk-dash-rate tfoot th, .mk-dash-rate tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.mk-dash-rate th[scope=row] { text-align: left; }

.mk-dash-evs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-width: 860px; }
.mk-dash-evs > li { padding: 8px 0; border-bottom: 1px solid var(--divider); }
.mk-dash-evs > li:first-child { padding-top: 0; }
.mk-dash-ev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
.mk-dash-ev > * { min-width: 0; }
.mk-dash-evn { flex: 1 1 200px; font-family: var(--mono); font-size: 13px; color: var(--grey-ink); overflow-wrap: anywhere; }
.mk-dash-evtag { font-family: var(--font); font-size: 12px; color: var(--muted); white-space: nowrap; }  /* a GA4 form event, counted under Website forms */
.mk-dash-ev input[data-mkd-evlabel] { flex: 2 1 220px; width: auto; }
.mk-dash-evo { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.mk-dash-evo input { width: 84px; }
.mk-dash-evadd { align-items: flex-end; max-width: 860px; }
.mk-dash-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; }
.mk-dash-field label { font-size: 13px; font-weight: 600; color: var(--grey-ink); }
.mk-dash-evfold .mk-dash-note, .mk-dash-evfold .msg { margin: 0; }
.mk-dash-evs .msg { margin-top: 8px; }
@media (pointer: coarse), (max-width: 720px) {
  .mk-dash-chk { min-height: 44px; }
  .mk-dash .btn.small { min-height: 44px; }
}
@media (max-width: 720px) {
  .mk-dash-tiles2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mk-dash-tiles2 .mk-dash-tile { padding: 10px; }
  .mk-dash-tiles2 .mk-dash-tv { font-size: 20px; }
  .mk-dash-evn { flex-basis: 100%; }
  .mk-dash-ev input[data-mkd-evlabel] { flex-basis: 100%; }
  .mk-dash-evadd .btn.small { flex: 1 1 100%; }
  .mk-dash-rate th, .mk-dash-rate td { padding-left: 6px; padding-right: 6px; }
  .mk-dash-rate thead th, .mk-dash-rate thead th.n { height: auto; padding-top: 6px; padding-bottom: 6px; white-space: normal; vertical-align: bottom; }  /* "Previous month" wraps, so the table fits a phone */
}

/* ---- Section 3, Business Profile (T11) ----
   Seven quiet tiles (one row on a wide screen, two columns on a phone); a figure nobody has typed in says "Not entered" in smaller grey
   text, at the same height as a figure. The actions and views charts share the .mk-dash-figs grid. The "Add / edit month" form is a
   grid of number boxes (two a row on a phone), then the notes box and Save. Boxes are 44px tall (styles.css); so is Save on a phone. */
.mk-dash-tiles7 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr)); }
.mk-dash-tv[data-mkd-na] { font-size: 15px; font-weight: 600; line-height: 30px; color: var(--muted); }
.mk-dash-gnote { margin: 0; font-size: 13px; color: var(--grey-ink); overflow-wrap: anywhere; }
.mk-dash-gbp { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 860px; min-width: 0; }
.mk-dash-gbp > * { min-width: 0; }
.mk-dash-gbpf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-self: stretch; }  /* 4 + 3: the actions, then the reviews */
.mk-dash-gbp .mk-dash-field { flex: none; min-width: 0; }
.mk-dash-gbpn { align-self: stretch; }
.mk-dash-gbpn textarea { min-height: 64px; }
.mk-dash-gbpfold .mk-dash-note, .mk-dash-gbpfold .msg { margin: 0; }
@media (max-width: 720px) {
  .mk-dash-tiles7 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mk-dash-tiles7 .mk-dash-tile { padding: 10px; }
  .mk-dash-tiles7 .mk-dash-tv { font-size: 20px; }
  .mk-dash-tiles7 .mk-dash-tv[data-mkd-na] { font-size: 15px; line-height: 25px; }
  .mk-dash-gbpf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mk-dash-gbp .btn.small { align-self: stretch; }
}

/* ---- Section 4, Cost per lead (T12) ----
   Two rows of three quiet tiles: the picked month, then the comparison month (quieter, no change line). A sentence in place of a figure
   ("No spend entered") uses the smaller grey text of "Not entered". The spend lines are a short list: the item (wraps), the amount, then
   Edit and Remove as text buttons, 44px tall on touch screens and phones. The form is the item, the amount and Save on one row. */
.mk-dash-cpl { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mk-dash-cplrow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mk-dash-cplm { margin: 0; font-size: 13px; font-weight: 600; color: var(--grey-ink); }
.mk-dash-cpl .mk-dash-tv[data-mkd-na] { font-size: 15px; font-weight: 600; line-height: 20px; padding: 5px 0; color: var(--muted); overflow-wrap: anywhere; }
.mk-dash-cpl .mk-dash-tiles3 .mk-dash-tl { flex: none; }  /* figures and sentences sit straight under their labels, changes at the foot */
.mk-dash-cpl .mk-dash-tc { margin-top: auto; }
.mk-dash-cplcmp .mk-dash-tile { background: transparent; }
.mk-dash-cplcmp .mk-dash-tv { font-size: 20px; color: var(--grey-ink); }
.mk-dash-cplcmp .mk-dash-tc:empty { display: none; }
.mk-dash-cpl .mk-dash-note { margin: 0; }
.mk-dash-splist { display: flex; flex-direction: column; gap: 4px; max-width: 640px; min-width: 0; }
.mk-dash-splist .mk-dash-cap { margin: 0; }
.mk-dash-spends { list-style: none; margin: 0; padding: 0; min-width: 0; }
.mk-dash-spends > li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 4px 0; border-bottom: 1px solid var(--divider); min-width: 0; }
.mk-dash-spi { flex: 1 1 180px; min-width: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.mk-dash-spa { flex: none; min-width: 88px; text-align: right; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mk-dash-spb { flex: none; display: inline-flex; gap: 16px; }
.mk-dash-spb .link, .mk-dash-spedit .link { min-height: 36px; }
.mk-dash-spfold .mk-dash-note, .mk-dash-spfold .msg, .mk-dash-spedit { margin: 0; }
.mk-dash-spedit { font-size: 14px; color: var(--grey-ink); overflow-wrap: anywhere; }
.mk-dash-spform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; max-width: 640px; min-width: 0; }
.mk-dash-spform > * { min-width: 0; }
.mk-dash-spform .mk-dash-spamt { flex: 0 1 160px; }
@media (pointer: coarse), (max-width: 720px) {
  .mk-dash-spb { gap: 4px; margin-left: -8px; }  /* the padding makes each a 44px square or wider; the text still lines up with the item */
  .mk-dash-spb .link, .mk-dash-spedit .link { min-height: 44px; min-width: 44px; padding: 0 8px; }
}
@media (max-width: 720px) {
  .mk-dash-cpl .mk-dash-tiles3 .mk-dash-tv { font-size: 17px; }
  .mk-dash-cpl .mk-dash-tiles3 .mk-dash-tv[data-mkd-na] { font-size: 14px; line-height: 18px; padding: 2px 0 1px; }
  .mk-dash-cplcmp .mk-dash-tiles3 .mk-dash-tv { font-size: 16px; }
  .mk-dash-spform .mk-dash-field { flex: 1 1 100%; }
  .mk-dash-spform .btn.small { flex: 1 1 100%; }
}

/* ---- Section 5, Top search terms (T14) ----
   The search box, the one-line biggest rise and fall (arrows with words), then the top 25 as a compact table: the term wraps anywhere
   (with its Brand / rise / fall marks under it), the four figures are right-aligned tabular numbers that never wrap. Headers are buttons
   that sort (aria-sort on the th); their text wraps so the table fits a phone without scrolling sideways. Terms are text, never links. */
.mk-dash-sec .search.mk-dash-q { max-width: 420px; }
.mk-dash-rf { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 14px; color: var(--grey-ink); }
.mk-dash-rfi { min-width: 0; overflow-wrap: anywhere; }
.mk-dash-rfq { font-weight: 600; color: var(--ink); }
.mk-dash-arr { font-weight: 700; }
.mk-dash-qbox { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mk-dash-qn { margin: 0; font-size: 13px; color: var(--muted); }
.mk-dash-qt thead th { height: auto; padding: 4px 10px; white-space: normal; vertical-align: bottom; }
/* The four figure columns take only the room they need (headers on one line each); the term takes the rest */
.mk-dash-qt th.n, .mk-dash-qt td.n { width: 1%; padding-left: 20px; }
.mk-dash-qt thead th.n { white-space: nowrap; text-align: right; }
.mk-dash-sort { appearance: none; display: inline-block; min-height: 36px; padding: 4px 0; border: 0; background: none; font: inherit; color: inherit;
  text-align: inherit; cursor: pointer; }
.mk-dash-sort:not(:disabled):hover, .mk-dash-sort:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.mk-dash-sort:disabled { cursor: default; }  /* the change column with no comparison figures */
.mk-dash-ths { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.mk-dash-sarr { margin-left: 4px; color: var(--ink); }
.mk-dash-qt tbody th[scope=row] { height: auto; padding: 6px 10px; border-top: 1px solid var(--divider); border-bottom: 0; background: none;
  font-size: 13px; font-weight: 400; color: var(--ink); white-space: normal; text-align: left; vertical-align: middle; }
.mk-dash-qtext { overflow-wrap: anywhere; }
.mk-dash-qm { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 2px; }
.mk-dash-qm .dotw { font-size: 12px; }
.mk-dash-qbox, .mk-dash-sec .mk-dash-rf { max-width: 760px; }
@media (max-width: 720px) {
  .mk-dash-sec .search.mk-dash-q { max-width: none; }
  .mk-dash-sort { min-height: 44px; }
}
/* On a phone each row is a small grid: the term (and its marks) across the top, the four figures under the four headers, so a long
   term gets the full width instead of a narrow column. The table keeps its roles in the HTML, so it's still a table to a screen reader. */
@media (max-width: 640px) {
  .mk-dash-qt, .mk-dash-qt thead, .mk-dash-qt tbody { display: block; }
  .mk-dash-qt tr { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 8px; align-items: end; padding: 8px 0; border-top: 1px solid var(--divider); }
  .mk-dash-qt thead tr { padding: 0 0 4px; border-top: 0; border-bottom: 1px solid var(--divider); }
  .mk-dash-qt tr > :first-child { grid-column: 1 / -1; }
  .mk-dash-qt thead th, .mk-dash-qt tbody th[scope=row], .mk-dash-qt td { display: block; width: auto; height: auto; padding: 0; border: 0; background: none; }
  .mk-dash-qt thead th, .mk-dash-qt thead th.n { white-space: normal; }
  .mk-dash-qt th.n, .mk-dash-qt td.n { width: auto; padding-left: 0; }
  .mk-dash-qt tbody th[scope=row] { padding-bottom: 2px; font-size: 14px; }
  .mk-dash-qt td { font-size: 14px; }
  .mk-dash-qt tbody tr:first-child { border-top: 0; }
}

/* ---- Section 6, Top landing pages (T15) ----
   The same table as section 5 (.mk-dash-qt: wrapping text first column, right-aligned tabular figures, sort buttons in the headers), with
   three figures instead of four. A row with 50+ sessions and no enquiries says so with an amber dot and words under the path (no row
   tint: the dot and word are enough). "Show all n" is a text button under the table. Paths are text and wrap anywhere. */
.mk-dash-pmore { margin: 0; }
.mk-dash-pmore .link { min-height: 36px; }
@media (max-width: 720px) {
  .mk-dash-pmore .link { min-height: 44px; }
}
@media (max-width: 640px) {
  .mk-dash-pt tr { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.5fr); padding-left: 6px; padding-right: 6px; }
  .mk-dash-pt thead tr { padding-left: 6px; padding-right: 6px; }
}

/* ---- Section 7, Google rankings (T16) ----
   The chart sits alone at full width. The target phrases reuse section 5's table (.mk-dash-qt):
   the phrase wraps, the three figures are right-aligned, and Pause/Resume and Remove are text buttons at the end of the row, 44px on
   touch screens and phones. A paused row is muted (grey text) and says "Paused" in words under the phrase. Then the add box and Add. */
.mk-dash-rank { max-width: none; }  /* full width, like the other single charts, so the month labels fit on one line */
.mk-dash-phs { display: flex; flex-direction: column; gap: 4px; max-width: 760px; min-width: 0; }
.mk-dash-phs .mk-dash-cap { margin: 0; }
.mk-dash-phs > .mk-dash-note { margin: 0 0 8px; }
.mk-dash-pht:focus { outline: none; }
.mk-dash-pht th.mk-dash-pha, .mk-dash-pht td.mk-dash-pha { width: 1%; padding-left: 20px; white-space: nowrap; text-align: right; }
.mk-dash-pha .link { min-height: 36px; }
.mk-dash-pha .link + .link { margin-left: 16px; }
.mk-dash-pht tr.mk-dash-paused th[scope=row], .mk-dash-pht tr.mk-dash-paused td.n { color: var(--muted); }
.mk-dash-phform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; max-width: 520px; min-width: 0; }
.mk-dash-phform > * { min-width: 0; }
.mk-dash-phs .msg { margin: 4px 0 0; }
@media (pointer: coarse), (max-width: 720px) {
  .mk-dash-pha .link { min-height: 44px; min-width: 44px; padding: 0 8px; }
  .mk-dash-pha .link + .link { margin-left: 4px; }
}
@media (max-width: 720px) {
  .mk-dash-phform .mk-dash-field { flex: 1 1 100%; }
  .mk-dash-phform .btn.small { flex: 1 1 100%; }
}
/* On a phone: the phrase (and "Paused") with its two buttons on the right, then the three figures under their headers. "Not seen in
   Google" wraps inside its column instead of running into the next one. */
@media (max-width: 640px) {
  .mk-dash-pht tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .mk-dash-pht thead th.mk-dash-pha { position: absolute; }  /* the screen-reader-only header takes no cell */
  .mk-dash-pht tbody tr > th:first-child { grid-column: 1 / 3; grid-row: 1; align-self: center; }
  .mk-dash-pht td.mk-dash-pha { grid-column: 3; grid-row: 1; display: flex; gap: 0; width: auto; margin: -10px -8px 0 0; padding: 0; justify-self: end; align-self: start; }
  .mk-dash-pht .mk-dash-pha .link + .link { margin-left: 0; }
  .mk-dash-pht td.n { white-space: normal; }
}

/* ---- Section 8, AI assistants (T17) ----
   Five quiet tiles (assistant, visits or "No visits", the change, enquiries), then section 5's table (.mk-dash-qt) with the landing page as
   a second text column. "Show all n" is section 6's text button. On a phone the tiles go two across (the fifth on its own row), and each
   table row is a small grid: the assistant and its landing page across the top, the three figures under their headers. */
.mk-dash-tiles5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); max-width: 920px; }
.mk-dash-tiles5 .mk-dash-tv[data-mkd-na] { font-size: 15px; font-weight: 600; line-height: 30px; color: var(--muted); }
.mk-dash-ait td.mk-dash-aip { padding: 6px 10px; font-size: 13px; vertical-align: middle; text-align: left; white-space: normal; }
.mk-dash-ait tbody th[scope=row] { white-space: nowrap; font-weight: 600; }
@media (max-width: 720px) {
  .mk-dash-tiles5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mk-dash-tiles5 .mk-dash-tile { padding: 10px; }
  .mk-dash-tiles5 .mk-dash-tv { font-size: 20px; }
  .mk-dash-tiles5 .mk-dash-tv[data-mkd-na] { font-size: 15px; line-height: 25px; }
}
@media (max-width: 640px) {
  .mk-dash-ait tr { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 6px; padding-right: 6px; }
  .mk-dash-ait thead tr { padding-left: 6px; padding-right: 6px; }
  .mk-dash-ait tr > :first-child { grid-column: 1; }
  .mk-dash-ait tr > :nth-child(2) { grid-column: 2 / -1; }
  .mk-dash-ait tr > :nth-child(n+3) { margin-top: 2px; }
  .mk-dash-ait tbody th[scope=row] { padding-bottom: 0; white-space: normal; }
  .mk-dash-ait td.mk-dash-aip { padding: 0; font-size: 14px; align-self: start; }
  .mk-dash-ait thead th:nth-child(2) { align-self: end; }
}
