/* athorion console (app. + dash.) - phone / tablet layer of web/console/index.html ONLY.
   Linked from index.html right after /mobile.css (bump ?v=N there on every change; Cloudflare caches .css).
   Rules:
   - every rule sits inside @media (max-width:899px) (sheets and cards inside (max-width:599px)), so desktop
     (>= 900px) renders exactly as before; never pointer:coarse / hover:none on their own;
   - shell selectors only (.ae-*, [data-screen-label], [data-sc-name]) plus the ae-m-* utilities below;
     the iframe pages (sales, outreach, workflows, infra, remediation) and graph.html style themselves;
   - the dc runtime re-serialises inline styles through React, so [style*=...] never matches: elements get a
     class by a targeted edit, and !important beats their inline style;
   - three selectors name an id (#aeth-lang-toggle twice, #pg-hero-input), always below a shell selector: they
     have to outrank existing id rules with !important (mobile.css `#aeth-lang-toggle{width:38px!important}`,
     index.html `[data-screen-label="U Agent"] #pg-hero-input{font-size:14px!important}`), which no
     class/attribute selector can.
   Utilities (add the class in index.html, they do nothing on desktop):
     ae-m-root / ae-m-main   console root (100dvh) / the scrolling <main>
     ae-m-tap                44x44 px minimum tap target
     ae-m-scrollx            the one allowed horizontal scroller (DoD 1), never scrolls vertically itself
     ae-m-g4 / ae-m-g2       fixed 4- / 2-column grids: 4 -> 2 columns below 900px, 2 -> 1 column below 600px
                             (4 short cells - stats, severity options - read better as 2x2 than as 4 rows)
     ae-m-wrap               a nowrap flex row (actions, status select) may wrap below 900px
     ae-m-pills              a segmented filter bar (its buttons are direct children): wraps into full rows of 44px
                             segments below 900px instead of running off the edge (DoD 6)
     ae-m-ctr                a flex-row button: its content stays vertically centred once the 44px minimum makes it taller
     ae-m-tip                the visible copy of a title tooltip (inline display:none on desktop): shown below 900px,
                             the tap path for text that is otherwise only in title (DoD 4)
     ae-m-sheet              an aria-modal dialog: bottom sheet below 600px, max-height in dvh, own scroll
     ae-m-sheet-full         ... a dialog with a fixed height (flex column with its own scrolling body)
     ae-m-sheetfoot          the action row inside a sheet's 20px-padded body: stays visible at the bottom while
                             the form scrolls (it bleeds over the body padding to the sheet edges)
     ae-m-sheetbar           the same for an action row that already spans the sheet (a direct child of the
                             dialog with its own padding): sticky, painted in the sheet's own background
     ae-m-embed              the wrapper of an embedded full-page iframe (sales, outreach, workflows, remediation):
                             fills main under the top bar, main itself does not scroll
     Below 900px every button in a sheetfoot / sheetbar is at least 44px high (centred dialogs 600-899px too).
     ae-m-drawer             a right-hand detail drawer (aside): full screen below 600px
     ae-m-drawerbar          its action row: 44px buttons, stays visible at the bottom while the drawer scrolls (< 600px)
   AthorionDataTable mobile modes (opt-in prop mobile="admin" | mobile="cards", see AthorionDataTable.dc.html):
     .ae-dt-m (both), .ae-dt-m-admin (one scroller, sticky checkbox + first column), .ae-dt-m-cards (cards < 600px). */

@media (max-width: 899px) {
  /* ---------------------------------------------------------------- root + main */
  /* 100dvh follows the mobile browser toolbar (100vh cuts the bottom off on iOS); no inline fallback possible */
  .ae-m-root { height: 100dvh !important; }

  /* ---------------------------------------------------------------- top bar: 44px targets, no overflow at 360px */
  .ae-top { gap: 4px !important; padding: 0 8px !important; }
  .ae-top .ae-actions { gap: 4px !important; }
  .ae-top .ae-iconbtn, .ae-top .ae-cmdbtn {
    min-width: 44px !important; height: 44px !important; box-sizing: border-box !important;
  }
  .ae-top > .ae-iconbtn { width: 44px !important; padding: 0 !important; display: grid !important; place-items: center !important; }
  .ae-top .ae-actions > .ae-iconbtn:not(.ae-acct) { width: 44px !important; }
  .ae-top .ae-cmdbtn { width: 44px !important; }
  .ae-top .ae-acct { justify-content: center !important; }
  .ae-top #aeth-lang-toggle { width: 44px !important; height: 44px !important; line-height: 42px !important; font-size: 16px !important; }
  /* the login view has no top bar: i18n.js puts the same select into its lang slot */
  .ae-m-root [data-screen-label="Login"] #aeth-lang-toggle { width: 44px !important; height: 44px !important; line-height: 42px !important; }
  /* the plan chip may give way, but never below its longest word: the free plan's "Upgrade" CTA keeps its full
     label in every language ("Mettre à niveau", "Aggiorna piano") and wraps onto two lines instead of being cut
     off with an ellipsis (the whole chip stays the button) */
  .ae-top .ae-planchip {
    height: 44px !important; min-width: 44px !important; box-sizing: border-box !important;
    flex: 0 1 auto !important; overflow: hidden; justify-content: center;
  }
  .ae-top .ae-planchip:has(.ae-pc-cta) { min-width: min-content !important; }
  .ae-top .ae-pc-cta { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: normal; text-align: center; }
  .ae-top .ae-logobtn { min-height: 44px !important; margin-right: 0 !important; }

  /* ---------------------------------------------------------------- navigation drawer + account menu: 44px rows */
  .ae-side .ae-navbtn { height: auto !important; min-height: 44px !important; }
  .ae-side button { min-height: 44px !important; }
  .ae-menu button { min-height: 44px !important; }

  /* ---------------------------------------------------------------- form fields: >= 16px (no iOS focus zoom, DoD 7) */
  .ae-m-root input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=color]):not([type=file]),
  .ae-m-root select, .ae-m-root textarea { font-size: 16px !important; min-width: 0; }
  /* (min-width:0: the bigger font widens a field's intrinsic size; in a flex row it may shrink instead of
     pushing its neighbours over the edge) */
  /* the agent's main input: an older inline rule (index.html, max-width 760px) pins it to 14px by id */
  .ae-m-root [data-screen-label="U Agent"] #pg-hero-input { font-size: 16px !important; }

  /* ---------------------------------------------------------------- utilities */
  .ae-m-tap { min-width: 44px !important; min-height: 44px !important; box-sizing: border-box !important; }
  .ae-m-scrollx {
    overflow-x: auto !important; overflow-y: hidden !important; max-height: none !important;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
  .ae-m-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ae-m-wrap { flex-wrap: wrap !important; min-width: 0 !important; max-width: 100%; }

  /* ---------------------------------------------------------------- dialogs: 44px actions (centred 600-899px too) */
  .ae-m-sheet .ae-m-sheetfoot > button, .ae-m-sheet .ae-m-sheetbar button { min-height: 44px; }
  /* 402 / plan dialog: the checkout buttons and the monthly / yearly switch (also on /app/plans) */
  .ae-m-sheet .ae-up-cta { min-height: 44px; }
  .ae-ivsw { min-height: 44px; }
  /* alert-rule builder stepper */
  .ae-m-sheet .ae-rbsteps > button { min-height: 44px; min-width: 44px; justify-content: center; }
  /* welcome-tour start card: "Let's go" / "Later" */
  .ae-m-sheet .ae-wt-go, .ae-m-sheet .ae-wt-x { min-height: 44px; }

  /* ---------------------------------------------------------------- AthorionDataTable (opt-in modes, both) */
  /* saved column widths / resize handles are ignored by the component itself below 900px; the handles go too */
  .ae-dt-m .ae-dt-rz { display: none !important; }
  /* the row's painted colour for what covers the row (checkbox ring, sticky first column): table, highlighted
     (rgba(127,200,255,.06) over the table), selected, hovered (style-hover paints #1d1b19); -l = the left 2px */
  .ae-dt-m .ae-dt-row { --ae-dt-stk: var(--t-161514ff-fg,#161514); --ae-dt-stk-l: var(--t-161514ff-fg,#161514); }
  .ae-dt-m .ae-dt-row.ae-dt-hl { --ae-dt-stk: var(--t-1c2022ff-fg,#1c2022); --ae-dt-stk-l: var(--t-7fc8ffff-bg,#7fc8ff); }
  .ae-dt-m .ae-dt-row.ae-dt-sel { --ae-dt-stk: var(--t-1a120cff-fg,#1a120c); --ae-dt-stk-l: var(--t-1a120cff-fg,#1a120c); }
  .ae-dt-m .ae-dt-row:hover { --ae-dt-stk: var(--t-1d1b19ff-fg,#1d1b19); --ae-dt-stk-l: var(--t-1d1b19ff-fg,#1d1b19); }
  .ae-dt-m .ae-dt-row.ae-dt-hl:hover { --ae-dt-stk-l: var(--t-7fc8ffff-bg,#7fc8ff); }
  /* checkbox: 44x44 hit area (border is the padding ring, the 1px outline draws the 14px box) */
  .ae-dt-m .ae-dt-ck {
    width: 44px !important; height: 44px !important; margin: -15px 0 !important; box-sizing: border-box !important;
    border: 15px solid var(--ae-dt-stk, #161514) !important; outline: 1px solid var(--t-5a5650ff-ln,#5a5650); outline-offset: -16px;
  }
  .ae-dt-m .ae-dt-head { height: 44px !important; }
  .ae-dt-m .ae-dt-head .ae-dt-ck { border-color: var(--t-1d1b19ff-ln,#1d1b19) !important; }
  /* the sort buttons fill the 44px header row (they were 14px text lines in it) */
  .ae-dt-m .ae-dt-hcell > button { align-self: stretch; min-height: 44px; }
  .ae-dt-m .ae-dt-bar button, .ae-dt-m .ae-dt-acts button { min-height: 44px !important; }
  .ae-dt-m .ae-dt-menu { top: 48px !important; }
  .ae-dt-m .ae-dt-foot button { min-width: 44px !important; min-height: 44px !important; }
  .ae-dt-m .ae-dt-copy { min-width: 44px !important; min-height: 44px !important; margin: -12px -14px !important; }
  /* admin: one horizontal scroller, checkbox + first content column stay put while it scrolls; the stacked
     shadows paint the row colour over the 70px in front of the first column for the full row height (the
     last 2px take the highlight bar colour, so a highlighted row keeps its blue edge) */
  .ae-dt-m-admin .ae-dt-ck { position: sticky; left: 12px; z-index: 3; }
  .ae-dt-m-admin .ae-dt-row > .ae-dt-cell:nth-child(2) {
    position: sticky; left: 70px; z-index: 2; align-self: stretch; justify-content: center;
    margin: -12px 0; padding: 12px 0; background: var(--ae-dt-stk);
    box-shadow: -14px 0 0 var(--ae-dt-stk), -28px 0 0 var(--ae-dt-stk), -42px 0 0 var(--ae-dt-stk), -56px 0 0 var(--ae-dt-stk),
                -68px 0 0 var(--ae-dt-stk), -70px 0 0 var(--ae-dt-stk-l), 10px 0 10px -10px var(--t-000000d9-sh,rgba(0, 0, 0, .85));
  }
  .ae-dt-m-admin .ae-dt-row.ae-dt-dense > .ae-dt-cell:nth-child(2) { margin: -6px 0; padding: 6px 0; }
  .ae-dt-m-admin .ae-dt-head > .ae-dt-hcell:nth-child(2) {
    position: sticky !important; left: 70px; z-index: 2; background: var(--t-1d1b19ff-bg,#1d1b19);
    box-shadow: -14px 0 0 var(--t-1d1b19ff-sh,#1d1b19), -28px 0 0 var(--t-1d1b19ff-sh,#1d1b19), -42px 0 0 var(--t-1d1b19ff-sh,#1d1b19), -56px 0 0 var(--t-1d1b19ff-sh,#1d1b19), -70px 0 0 var(--t-1d1b19ff-sh,#1d1b19),
                10px 0 10px -10px var(--t-000000d9-sh,rgba(0, 0, 0, .85));
  }

  /* ---------------------------------------------------------------- the wordmark on the narrowest bars */
  /* Two narrower steps, nested in this 899px block: they depend on the bar's real width, which 599px cannot
     express, and both only hide the wordmark. The free plan chip with its "Upgrade" CTA leaves no readable room
     for it below 390px with 44px targets (at 390-439px it scales into the free gap, ~47px wide); "Overview" in
     the drawer goes to the same place (goHome). Below 360px a scaled wordmark is too small to read. */
  @media (max-width: 389px) {
    .ae-top:has(.ae-pc-cta) .ae-logobtn { display: none !important; }
  }
  @media (max-width: 359px) {
    .ae-top .ae-logobtn { display: none !important; }
  }
}

/* ==================================================================== A1: marketing, settings (mail templates), API keys */
@media (max-width: 899px) {
  .ae-m-ctr { align-items: center !important; }
  .ae-m-tip { display: block !important; }

  /* 44px targets: every button of the three owner screens (the AthorionDataTable in Settings brings its own,
     mobile="admin"), the 2FA / Lead-CRM links and the API-key secret fields */
  [data-screen-label="A Marketing"] button,
  [data-screen-label="A API Keys"] button,
  [data-screen-label="A Settings"] button:not([data-sc-name="AthorionDataTable"] *),
  [data-screen-label="A Settings"] a[href],
  [data-screen-label="A API Keys"] input { min-width: 44px; min-height: 44px; box-sizing: border-box; }
  /* governance switches: the 44px button keeps the 34x18 track at the right edge, vertically centred */
  [data-screen-label="A Settings"] [role="switch"] { display: inline-flex; align-items: center; justify-content: flex-end; }

  /* campaign editor + mail-template editor: the 300px list column squeezed the editor to ~40px (and the
     preview to ~390px at 768). List on top (own scroll, capped so the editor follows), editor full width. */
  .ae-etgrid { grid-template-columns: minmax(0, 1fr) !important; }
  .ae-etgrid > :first-child {
    border-right: 0 !important; border-bottom: 1px solid var(--t-1f1d1bff-ln,#1f1d1b); max-height: max(240px, 45dvh) !important;
  }
  /* audience / enrol source chips: the consent explanation (their title) is printed in the chip */
  .ae-mkchip { flex-wrap: wrap; align-items: center; text-align: left; }
  .ae-mkchip > .ae-m-tip {
    flex: 1 0 100%; font-family: 'Geist', sans-serif; font-size: 11.5px; line-height: 1.4; opacity: .8; white-space: normal;
  }
  /* NIS2 orders and recent sends: long domains / addresses break instead of pushing the row wider; the
     truncated subject of a send is shown in full (it was only in its title) */
  .ae-mkord > span, .ae-etsend > span { overflow-wrap: anywhere; }
  .ae-etsend > span[title] { white-space: normal !important; }

  /* API keys: the 8-column list scrolls sideways inside its card (the one scroller, ae-m-scrollx); the partner
     column stays put while it does (Revoke is destructive: the row's name never scrolls away). The partner cell
     covers the row's full height (its 12px padding, 44px line) so the cells passing under it never peek out. */
  .ae-aktbl { min-width: 832px; }
  .ae-aktbl > :first-child {
    position: sticky; left: 0; z-index: 1; align-self: stretch; margin: -12px 0; padding: 12px 0; line-height: 44px;
    background: var(--t-161514ff-bg,#161514); box-shadow: 10px 0 10px -10px var(--t-000000d9-sh,rgba(0, 0, 0, .85));
  }
  .ae-aktbl.ae-akhead > :first-child { margin: -11px 0; padding: 11px 0; line-height: inherit; }
}

/* ==================================================================== A2: accounts, account detail, authorizations, audit, plans */
@media (max-width: 899px) {
  /* AthorionDataTable mobile="admin" (now on every owner table of these screens): a value longer than its column
     wraps instead of being cut with an ellipsis whose full text was only in the title (DoD 4, e.g. the operator
     e-mail in Settings); the sticky first column (capped at 32vw by the component) wraps its name; a header label
     wraps rather than lose letters */
  .ae-dt-m-admin .ae-dt-val, .ae-dt-m-admin .ae-dt-cell > span, .ae-dt-m-admin .ae-dt-hcell > button {
    white-space: normal !important; overflow-wrap: anywhere;
  }
  .ae-dt-m-admin .ae-dt-acts button { min-width: 44px; justify-content: center; }
  .ae-dt-m-admin .ae-dt-hcell > button { min-width: 44px !important; }
  /* the 44px copy target takes the 12px the column width reserves for it (not 16px), so it stays beside its value */
  .ae-dt-m-admin .ae-dt-copy { margin: -12px -16px !important; }
  /* an empty table: the component gives the inner box the scroller's width, so the empty text is centred in view;
     the header row keeps its columns (and its background under them) */
  .ae-dt-m-admin .ae-dt-inner:has(.ae-dt-empty) > .ae-dt-head { width: max-content; min-width: 100%; box-sizing: border-box; }

  /* 44px targets: every button / select of the five screens outside the tables (they bring their own), the
     pricing link. Account detail: 44px high only (its flex:1 nowrap buttons - simulate a purchase - must keep
     their min-content width, or they shrink into one row and overflow); its tabs get the 44px width as well. */
  [data-screen-label="A Accounts"] button:not([data-sc-name="AthorionDataTable"] *),
  [data-screen-label="A Authorizations"] button:not([data-sc-name="AthorionDataTable"] *),
  [data-screen-label="A Audit"] button:not([data-sc-name="AthorionDataTable"] *),
  [data-screen-label="A Audit"] select:not([data-sc-name="AthorionDataTable"] *),
  .ae-acct-tabs > button,
  [data-screen-label="A Plans"] a[href] { min-width: 44px; min-height: 44px; box-sizing: border-box; }
  [data-screen-label="A Account detail"] button:not([data-sc-name="AthorionDataTable"] *) { min-height: 44px; box-sizing: border-box; }
  [data-screen-label="A Plans"] a[href] { display: inline-flex; align-items: center; }

  /* account detail: the six tabs wrap onto two 44px lines without the 24px row gap between them */
  .ae-acct-tabs { gap: 0 18px !important; }
  /* plan select + Quota + Suspend: the select keeps its full line (it was squeezed to "Cyber In"), the two
     buttons share the next one */
  .ae-acct-planrow { flex-wrap: wrap !important; }
  .ae-acct-planrow > select { flex: 1 1 100% !important; }
  .ae-acct-planrow > button { flex: 1 1 0; }

  /* the detail drawer (shared: asset / CVE / scan findings): 44px close and action buttons */
  .ae-m-drawerbar > button { min-height: 44px; }
}

/* ==================================================================== A4: Lead CRM, Feedback, Identity checks (pill + filter bars) */
@media (max-width: 899px) {
  /* 44px targets: every button, select, field and link of the three owner screens. This also repairs the P1
     regression on the status rows: once ae-m-wrap let them wrap, the note button ("✎ Add") was a 31px one-liner. */
  [data-screen-label="A Lead CRM"] button, [data-screen-label="A Lead CRM"] select, [data-screen-label="A Lead CRM"] input,
  [data-screen-label="A Feedback"] button, [data-screen-label="A Feedback"] select, [data-screen-label="A Feedback"] input,
  [data-screen-label="A Feedback"] a[href],
  [data-screen-label="A Identity KYC"] button { min-width: 44px; min-height: 44px; box-sizing: border-box; }

  /* stage filters (6 / 5 / 4 segments): the segments wrap into full rows instead of running off the edge; each
     segment grows so every row is filled, and draws its own right + bottom hairline (the bar keeps top + left) */
  .ae-m-pills { flex-wrap: wrap !important; max-width: 100% !important; border-right-width: 0 !important; border-bottom-width: 0 !important; }
  .ae-m-pills > button { flex: 1 1 auto; border-bottom: 1px solid var(--t-2a2825ff-ln,#2a2825) !important; }

  /* rows: long addresses, domains and host names break instead of pushing the row wider (the feedback message
     keeps its 200px minimum: it grows from 0, so without it the row would squeeze it to a few px at 600-899px);
     the deep-check rows (one nowrap button each) wrap; on the identity cards long names and reasons break */
  .ae-crmrow > span, .ae-fbrow > span:not(.ae-fbmsg), .ae-crmchk > span:first-child { min-width: 0 !important; overflow-wrap: anywhere; }
  .ae-crmchk { flex-wrap: wrap !important; row-gap: 4px !important; }
  [data-screen-label="A Identity KYC"] span, [data-screen-label="A Identity KYC"] div { overflow-wrap: anywhere; }

  /* feedback message: the full text was only in its title (DoD 4, Vorgabe 7). It shows up to three lines, and a
     tap on it opens the details sheet with the whole message (f.peek, narrow only); 44px high, text centred. */
  .ae-fbmsg {
    display: flex !important; align-items: center; min-height: 44px; white-space: normal !important; overflow-wrap: anywhere; cursor: pointer;
  }
  .ae-fbmsg > .sc-interp {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; line-height: 1.45;
  }
}

@media (max-width: 599px) {
  /* A4 rows become small cards. The status group (select, note button, time) dissolves into the row
     (display:contents), so its parts can be placed with order:
       lead:      e-mail / domain + badges ... time / stage select + note button
       feedback:  kind + source ... time / who / message / status select + note button (+ screenshot)
     The select keeps its widest option (min-width:auto, at most the row): it is never clipped, the note button
     moves to the next line instead when both do not fit. */
  .ae-crmrow > .ae-m-wrap, .ae-fbrow > .ae-m-wrap { display: contents !important; }
  .ae-crmrow > .ae-m-wrap > span:last-child, .ae-fbrow > .ae-m-wrap > span:last-child { margin-left: auto; }
  .ae-m-root .ae-crmrow > .ae-m-wrap > select, .ae-m-root .ae-fbrow > .ae-m-wrap > select { flex: 1 1 0; min-width: auto; max-width: 100%; }
  .ae-crmrow > .ae-m-wrap > button, .ae-fbrow > .ae-m-wrap > button { flex: none; }
  /* lead: the e-mail has the first line; a zero-height full-width item breaks the line before the controls */
  .ae-crmrow > span:first-child { flex: 1 1 100%; }
  .ae-crmrow::after { content: ""; order: 1; flex: 1 0 100%; height: 0; }
  .ae-crmrow > .ae-m-wrap > select, .ae-crmrow > .ae-m-wrap > button { order: 2; }
  /* feedback: who and the message get a line each, the controls follow; the screenshot link goes last */
  .ae-fbrow > span:nth-child(4) { order: 1; flex: 1 1 100%; }
  .ae-fbrow > .ae-fbmsg { order: 2; flex: 1 1 100% !important; }
  .ae-fbrow > .ae-m-wrap > select, .ae-fbrow > .ae-m-wrap > button { order: 3; }
  .ae-fbrow > .ae-m-wrap > a { order: 4; display: inline-flex; align-items: center; }
  /* deep checks: the host has the first line, score / findings / time the second */
  .ae-crmchk > span:first-child { flex: 1 1 100%; }
  /* filter rows under the stage bar: the source / kind selects fill their line */
  .ae-m-pills ~ select { flex: 1 1 auto; }
}

/* ==================================================================== A5: embedded owner pages */
@media (max-width: 899px) {
  /* sales / outreach / workflows / remediation (wrapper .ae-m-embed): the iframe fills the area under the top bar,
     edge to edge and without the 560px minimum, so main does not scroll on these screens - only the page inside
     (the pages style themselves for phones). main-pad's 20px/16px/56px padding and the wrapper's -8px/-56px margins
     go; height:100% resolves against main (a stretched flex item of the 100dvh root). */
  .ae-main-pad:has(> .ae-m-embed) { height: 100% !important; max-width: none !important; padding: 0 !important; }
  .ae-m-embed { height: 100%; margin: 0 !important; }
  .ae-m-embed > iframe { height: 100% !important; min-height: 0 !important; }
  /* infra keeps its content height (postMessage, index.html onInfraMsg); the LLM backend card above it gets 44px buttons */
  [data-screen-label="A Infrastructure"] button { min-height: 44px; box-sizing: border-box; }
}

@media (max-width: 599px) {
  /* ---------------------------------------------------------------- 2-column field pairs stack */
  .ae-m-g2 { grid-template-columns: minmax(0, 1fr) !important; }

  /* ---------------------------------------------------------------- A1: mail previews use the editor's full width */
  /* the campaign / template preview bleeds over the editor's 16px side padding: at 360px the mail gets 326px
     instead of 294px (mail_render's shell needs ~306px: logo + tagline header, 20px phone padding) */
  .ae-etgrid iframe { width: calc(100% + 32px) !important; margin: 0 -16px; box-sizing: border-box; border-left: 0 !important; border-right: 0 !important; }

  /* ---------------------------------------------------------------- top bar on phones */
  /* the plan chip keeps its CTA: the status dot goes when "Upgrade" is shown */
  .ae-top .ae-planchip { padding: 0 4px !important; gap: 6px !important; }
  .ae-top .ae-planchip:has(.ae-pc-cta) .ae-pc-dot { display: none !important; }
  /* 561-599px still shows feedback + theme (mobile.css hides them at 560px): the role tag makes room */
  .ae-top .ae-apptag { display: none !important; }
  /* the wordmark is the item that yields on a narrow bar: it scales down (aspect kept) instead of pushing
     the 44px targets over the edge (360px, plan chip without "Upgrade": 56px instead of 72px wide) */
  .ae-top .ae-logobtn { flex: 0 1 auto !important; min-width: 0 !important; }
  .ae-top .ae-logobtn img.ae-logo { height: auto !important; max-height: var(--ae-logo-h, 24px); max-width: 100%; min-width: 0; }

  /* ---------------------------------------------------------------- alert-rule builder */
  /* header: title + close on the first line, the stepper on its own full-width line; a step that is not the
     current one shows its number (or tick) only, so the three steps fit 320px in every language */
  .ae-m-sheet .ae-rbhead > .ae-m-tap { margin-left: auto !important; }
  .ae-m-sheet .ae-rbsteps { order: 3; flex: 1 0 100% !important; }
  .ae-m-sheet .ae-rbsteps > button:not([aria-current="step"]) { padding: 0 !important; }
  .ae-m-sheet .ae-rbsteps > button:not([aria-current="step"]) > .sc-interp { display: none !important; }
  /* body: the 260-300px summary column no longer squeezes the step form to ~100px; both stack in one scroller
     between the fixed header and the footer with the main action */
  .ae-m-sheet .ae-rbbody { display: block !important; overflow-x: hidden !important; overflow-y: auto !important; overscroll-behavior: contain; }
  .ae-m-sheet .ae-rbbody > div { overflow: visible !important; }
  .ae-m-sheet .ae-rbbody > div + div { border-left: 0 !important; border-top: 1px solid var(--t-24221fff-ln,#24221f); }

  /* ---------------------------------------------------------------- 402 / plan dialog */
  /* a plan's checkout button stays in view at the bottom of the sheet while its card is on screen (with the
     keyboard up, 390x450, it sat below the fold); the 8px ring in the card colour masks the text it passes.
     Sticky insets count from the sheet's padding box minus its padding (20px here): -12px leaves 8px. */
  .ae-m-sheet:has(.ae-up-cta) { padding-bottom: 20px !important; }
  .ae-m-sheet .ae-up-cta { position: sticky; bottom: -12px; z-index: 2; box-shadow: 0 0 0 8px var(--t-161514ff-sh,#161514); }
  .ae-m-sheet .ae-up-cta:not(.ae-up-hi) { background-color: var(--t-161514ff-bg,#161514) !important; }
  .ae-m-sheet .ae-up-cta.ae-up-hi { box-shadow: 0 0 0 8px var(--t-0d0806ff-sh,#0d0806); }

  /* ---------------------------------------------------------------- dialogs become bottom sheets */
  .ae-m-sheet {
    position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    transform: none !important; margin: 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important;
    height: auto !important; max-height: 92dvh !important; overflow-y: auto !important; overflow-x: hidden !important;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-sizing: border-box !important;
    border-bottom-width: 0 !important; border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important;
  }
  .ae-m-sheet.ae-m-sheet-full { height: 92dvh !important; }
  .ae-m-sheet .ae-m-sheetfoot {
    position: sticky; bottom: 0; z-index: 3; flex-wrap: wrap;
    margin: 0 -20px !important; padding: 12px 20px !important; background: var(--t-1d1b19ff-bg,#1d1b19); border-top: 1px solid var(--t-2a2825ff-ln,#2a2825);
  }
  /* (delete account, AUP attest, pen-test intro, activate credit, welcome, new release): the action row keeps
     its own side padding and takes the dialog's background; the hairline marks where the form scrolls under */
  .ae-m-sheet .ae-m-sheetbar {
    position: sticky; bottom: 0; z-index: 3; background: inherit;
    padding-top: 12px !important; padding-bottom: 12px !important; box-shadow: 0 -1px 0 var(--t-2a2825ff-sh,#2a2825);
  }

  /* ---------------------------------------------------------------- AthorionDataTable: cards (mobile="cards") */
  .ae-dt-m-cards .ae-dt-scroll { overflow: visible !important; max-height: none !important; }
  .ae-dt-m-cards .ae-dt-inner { min-width: 0 !important; }
  /* the header row becomes one swipeable line of sort chips (select-all first); the chip IS its sort button
     (44px high, at least 44px wide) */
  .ae-dt-m-cards .ae-dt-head {
    position: static !important; display: flex !important; align-items: center !important; gap: 6px !important;
    height: auto !important; padding: 6px 12px !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .ae-dt-m-cards .ae-dt-head::-webkit-scrollbar { display: none; }
  .ae-dt-m-cards .ae-dt-head .ae-dt-ck { flex: none; margin: 0 !important; }
  .ae-dt-m-cards .ae-dt-hcell { flex: none; height: auto !important; }
  .ae-dt-m-cards .ae-dt-hcell > button {
    flex: none !important; min-width: 44px !important; min-height: 44px; box-sizing: border-box;
    padding: 0 10px !important; border: 1px solid var(--t-2a2825ff-ln,#2a2825) !important; text-align: center !important;
  }
  .ae-dt-m-cards .ae-dt-hacts { display: none !important; }
  /* each row is a card of "Label: value" lines; the first card-top fields show, the rest opens with Expand */
  .ae-dt-m-cards .ae-dt-row {
    position: relative; display: flex !important; flex-direction: column !important; align-items: stretch !important;
    gap: 8px !important; padding: 12px 12px 12px 52px !important;
  }
  .ae-dt-m-cards .ae-dt-row .ae-dt-ck { position: absolute; left: 4px; top: 4px; margin: 0 !important; }
  .ae-dt-m-cards .ae-dt-cell {
    display: grid !important; grid-template-columns: minmax(72px, 34%) minmax(0, 1fr); column-gap: 10px; row-gap: 3px; align-items: baseline;
  }
  .ae-dt-m-cards .ae-dt-lbl {
    display: block !important; grid-row: 1 / span 2; min-width: 0; overflow-wrap: anywhere;
    font-family: 'Geist Mono', monospace; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--t-8d887fff-fg,#8d887f);
  }
  .ae-dt-m-cards .ae-dt-lbl::after { content: ":"; }
  .ae-dt-m-cards .ae-dt-cell > * { grid-column: 2; }
  .ae-dt-m-cards .ae-dt-cell > .ae-dt-lbl { grid-column: 1; }
  .ae-dt-m-cards .ae-dt-val { white-space: normal !important; overflow-wrap: anywhere; }
  .ae-dt-m-cards .ae-dt-copy { margin: -10px 0 !important; }
  .ae-dt-m-cards .ae-dt-row:not(.ae-dt-open) > .ae-dt-more { display: none !important; }
  .ae-dt-m-cards .ae-dt-xp {
    display: inline-flex !important; align-self: flex-start; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
    background: transparent; border: 1px solid var(--t-2a2825ff-ln,#2a2825); color: var(--t-d8d3caff-fg,#d8d3ca); font-family: 'Geist Mono', monospace; font-size: 12px; cursor: pointer;
  }
  .ae-dt-m-cards .ae-dt-acts { justify-content: flex-start !important; flex-wrap: wrap; }

  /* ---------------------------------------------------------------- A2: detail drawer full screen */
  /* min(560px,100%) left a strip of the page at 561-599px; the action row sticks to the bottom edge of the
     drawer's scrolling body (its 18px bottom padding is bled over), so the main action is in view with the
     keyboard up (390x450) */
  .ae-m-drawer { width: 100% !important; border-left: 0 !important; }
  .ae-m-drawer .ae-m-drawerbar {
    position: sticky; bottom: -18px; z-index: 2; margin: 0 -20px -18px !important; padding: 12px 20px !important;
    background: var(--t-1d1b19ff-bg,#1d1b19); border-top: 1px solid var(--t-2a2825ff-ln,#2a2825);
  }
  .ae-m-drawer .ae-m-drawerbar:empty { display: none; }
}

/* ==================================================================== A3: campaigns, data & index, index search,
   host detail, overview, funnel, blocklist & abuse. Index search ("U Search": owner /admin/search and customer
   /app/search) and host detail ("U Host detail": /admin/hosts/<ip> and /app/hosts/<ip>) are one template each,
   so their rules act on both hosts. Screen classes added by targeted edits in index.html: ae-srgrid, ae-sfh(-l,
   -tg), ae-sfacets(-closed), ae-sfb, ae-sugg, ae-sres-pre, ae-smap(-ctl, -note), ae-hports, ae-hport, ae-hhist,
   ae-stools, ae-scamp(h), ae-scmap(-on, -z), ae-livedisc(h), ae-heatgrid, ae-topprod; ae-m-tip shows the absolute
   "last seen" time of a search result / host. */
@media (max-width: 899px) {
  /* 44px targets: every button of these screens (an AthorionDataTable with mobile="admin" brings its own; the
     customer's host CVE table keeps the desktop table until U2), the sort select, the campaign scope label */
  [data-screen-label="A Overview"] button:not([data-sc-name="AthorionDataTable"] *),
  [data-screen-label="A Funnel"] button,
  [data-screen-label="A Campaigns"] button,
  [data-screen-label="A Campaigns"] label,
  [data-screen-label="A Blocklist and abuse"] button:not([data-sc-name="AthorionDataTable"] *),
  [data-screen-label="U Search"] button,
  [data-screen-label="U Search"] select,
  [data-screen-label="U Host detail"] button:not([data-sc-name="AthorionDataTable"] *) { min-width: 44px; min-height: 44px; box-sizing: border-box; }

  /* ---------------------------------------------------------------- index search (both hosts) */
  /* results first, the facets + saved-searches column after them (Vorgabe 6); the one column may shrink below its
     widest facet row (min-content 470px pushed the page 111px sideways at 375px) */
  .ae-srgrid { grid-template-columns: minmax(0, 1fr) !important; }
  .ae-srgrid > :first-child { order: 1; min-width: 0; }
  /* the facet list folds behind its header: the header label becomes the toggle (closed by default) */
  .ae-sfh { padding-top: 0 !important; padding-bottom: 0 !important; }
  .ae-sfh-l { display: none !important; }
  .ae-sfh-tg {
    display: flex !important; flex: 1 1 auto; align-items: center; gap: 10px; padding: 0; text-align: left;
    background: none; border: 0; cursor: pointer; color: var(--t-bdb8afff-fg,#bdb8af);
    font-family: 'Geist Mono', monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  }
  .ae-sfh-tg > span:last-child { font-size: 15px; letter-spacing: 0; color: var(--t-f2efe9ff-fg,#f2efe9); }
  .ae-sfacets-closed { display: none !important; }
  .ae-sfh:has(+ .ae-sfacets-closed) { border-bottom-color: transparent !important; }
  /* autocomplete: no 320px minimum wider than the query bar */
  .ae-sugg { min-width: 0 !important; }
  /* a long unbroken banner token wraps inside its 118px preview instead of being cut off at the right edge */
  .ae-sres-pre { overflow-wrap: anywhere; }
  /* the result toolbar (list / map, sort, save) may shrink to the line: its 16px sort select (P1) pushed it 6px
     over at 360px; the select then shrinks with it */
  .ae-stools { min-width: 0; max-width: 100%; }
  [data-screen-label="U Search"] select { max-width: 100%; text-overflow: ellipsis; }
  /* result map (Vorgabe 8): it had touch-action none, so a swipe on it moved nothing; the page scrolls now (map
     dragging is a mouse gesture, + / - / Reset zoom), the controls are 44px (rule above) */
  .ae-smap { touch-action: pan-y !important; }

  /* ---------------------------------------------------------------- host detail (both hosts) */
  /* the observation history breaks a long unbroken banner (it pushed the page 280px sideways at 375px) */
  .ae-hhist > :last-child { min-width: 0; overflow-wrap: anywhere; }

  /* an empty table in the admin DataTable mode (host CVEs, blocklist): its "nothing here" line is centred in the
     visible width instead of the 700px+ column width it scrolled half out of view in */
  .ae-dt-m-admin .ae-dt-inner:not(:has(> .ae-dt-row)) { min-width: 0 !important; }

  /* ---------------------------------------------------------------- campaigns */
  /* the decorative scan map (no labels, no pointer handling on desktop) gets zoom buttons below 900px; at 1x the
     page scrolls over it, zoomed in one finger pans it (.ae-scmap-on, index.html scanZoom / _bindScanPan) */
  .ae-scmap { position: relative; }
  .ae-scmap canvas { touch-action: pan-y; }
  .ae-scmap.ae-scmap-on canvas { touch-action: none; }
  .ae-scmap-z { display: flex !important; position: absolute; left: 12px; bottom: 12px; gap: 6px; }
  .ae-scmap-z > button {
    padding: 0 12px; background: var(--t-24221fff-bg,#24221f); border: 1px solid var(--t-2a2825ff-ln,#2a2825); color: var(--t-d8d3caff-fg,#d8d3ca); cursor: pointer;
    font-family: 'Geist Mono', monospace; font-size: 14px;
  }
  .ae-scmap-z > button:last-child { font-size: 11px; }
}

@media (max-width: 599px) {
  /* ---------------------------------------------------------------- index search */
  /* filter-chip menus open under the whole chip row at full width (a chip near the right edge pushed its 240px
     menu over the edge); z-index 20 keeps them above the click-away layer (z 18) as the open chip's wrapper did */
  .ae-sf { position: relative; }
  .ae-sf .ae-sfb { position: static !important; }
  .ae-sfb .ae-onb-panel { left: 0 !important; right: 0 !important; min-width: 0 !important; max-width: none !important; z-index: 20; }
  /* the map keeps its whole width: zoom controls and the source note sit below it instead of over it */
  .ae-smap-ctl { position: static !important; padding: 8px 12px 0; flex-wrap: wrap; }
  .ae-smap-note { position: static !important; margin: 8px 12px 12px; }

  /* ---------------------------------------------------------------- host detail */
  /* ports: each row stacks (port + service + arrow / product / last seen) instead of a 560px row in a sideways
     scroller */
  .ae-hports { overflow-x: visible !important; }
  .ae-hports > div { min-width: 0 !important; }
  .ae-hport { grid-template-columns: minmax(64px, auto) minmax(0, 1fr) 20px !important; row-gap: 4px !important; }
  .ae-hport > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .ae-hport > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .ae-hport > :nth-child(3) { grid-column: 1 / 3; grid-row: 2; min-width: 0; overflow-wrap: anywhere; }
  .ae-hport > :nth-child(4) { grid-column: 1 / 3; grid-row: 3; }
  .ae-hport > :nth-child(5) { grid-column: 3; grid-row: 1 / 4; align-self: center; }

  /* ---------------------------------------------------------------- campaigns */
  /* campaign list: the name gets the full first line (it was squeezed to ~45px), rate / progress / status below,
     the 44px options button spans both lines; the header becomes one line of sort buttons */
  .ae-scamp { grid-template-columns: 74px minmax(0, 1fr) auto 44px !important; row-gap: 8px !important; }
  .ae-scamp > :nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .ae-scamp > :nth-child(2) { grid-column: 1; grid-row: 2; }
  .ae-scamp > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .ae-scamp > :nth-child(4) { grid-column: 3; grid-row: 2; }
  .ae-scamp > :nth-child(5) { grid-column: 4; grid-row: 1 / 3; align-self: center; }
  .ae-scamp.ae-scamph { display: flex !important; flex-wrap: wrap; column-gap: 18px !important; row-gap: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  /* live discoveries: time + IP on the first line, port (it can carry a long "#check" suffix) and the finding on
     their own full-width lines; the header is one line of labels. The feed-in animation's 44px max-height would
     clip the extra lines, so the cap goes (opacity / flash stay) */
  .ae-livedisc { grid-template-columns: auto minmax(0, 1fr) !important; row-gap: 4px !important; max-height: none !important; }
  .ae-livedisc > :nth-child(1) { white-space: nowrap; }
  .ae-livedisc > :nth-child(n+3) { grid-column: 1 / -1; }
  .ae-livedisc > span { min-width: 0; overflow-wrap: anywhere; }
  .ae-livedisc.ae-livedisch { display: flex !important; flex-wrap: wrap; gap: 4px 14px !important; }
  /* map zoom controls below the map (it is ~160px high on a phone) */
  .ae-scmap-z { position: static; padding: 6px 0 2px; }

  /* ---------------------------------------------------------------- data & index */
  /* freshness heatmap: 1px column gaps give the 24 hour cells ~10px instead of ~8px */
  .ae-heatgrid { column-gap: 1px !important; }
  /* top products: the name gets its own full line (it was cut at 150px), bar and count below */
  .ae-topprod { grid-template-columns: minmax(0, 1fr) 64px !important; row-gap: 6px !important; }
  .ae-topprod > :first-child { grid-column: 1 / -1; white-space: normal !important; overflow-wrap: anywhere; }
}

/* UX audit DA-06: tap targets on phones. Buttons and links styled as buttons in the page body are at least 40px
   high (WCAG 2.2 asks for 24px, the platforms recommend 44px); the data table sets its own 44px targets above. */
@media (max-width: 600px) {
  .ae-m-main button:not(.ae-dt-ck):not(.ae-navbtn), .ae-m-main select, .ae-m-main a[role="button"] { min-height: 40px; }
}
