/* CEO Command Center — Apple-native iPhone / mobile layout (<= 768px & native-phone).
   Desktop (>= 1024px) is untouched; every rule here is strictly scoped to mobile viewports.
   Owner Scrawl 7: ONE compact top row, icon theme pill, left-aligned money cards with the chevron
   clear of the label, and a Pipeline River whose eight stages all fit the phone with nothing clipped. */

.ceo-mobile-back { display: none; }
.ceo-mtitle { display: none; }

@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: hidden; }

  /* ---- ONE sticky top row: back + mark + title | theme icons + EN|ES + avatar ---- */
  .top {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto !important;
    min-height: 0 !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 6px !important;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px !important;
    background: color-mix(in srgb, var(--bg) 88%, transparent) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
    border-bottom: 1px solid var(--line-soft);
  }

  .ceo-mobile-back {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass-solid);
    color: var(--text);
    text-decoration: none;
    order: 0;
  }
  .ceo-mobile-back:active { transform: scale(.95); }

  .top > .brand {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    gap: 7px !important;
    order: 1;
  }
  .top > .brand .logo { width: 28px !important; height: 28px !important; flex: none; }
  html[data-theme="light"] .top > .brand .logo { content: url("../office-next/iovo-mark-day.png"); }
  .top > .brand .ttl { min-width: 0; }
  .top > .brand .ttl b {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 14px !important;
    line-height: 1.15 !important;
    letter-spacing: -.01em;
    white-space: normal !important;
    overflow-wrap: break-word;
  }
  .top > .brand .ttl .tag { display: none !important; }
  /* Scrawl 8: "CEO Command" + dealer caption (ceo-platform.js), never a cramped 2-line full title. */
  .top > .brand .ttl > #app-title { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
  .top > .brand .ttl > .ceo-mtitle { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 1px; }
  .top > .brand .ttl > .ceo-mtitle b { font-size: 16px; line-height: 1.15; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top > .brand .ttl > .ceo-mtitle small { font-size: 11.5px; line-height: 1.2; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .top > .tools {
    display: contents !important;
  }
  .top .when,
  .top .live,
  .top #ceo-visual-settings { display: none !important; }

  /* Language: universal round pill [EN | ES] matching Proposal V2 Setup */
  .top #langs {
    flex: none !important;
    order: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    height: 36px !important;
    padding: 3px !important;
    border-radius: 999px !important;
  }
  .top #langs button {
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 7px !important;
    border-radius: 999px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
  }

  /* Theme: universal round pill [💧 | ☀ | ☾] matching iovo-icons.css across the entire IOVO platform */
  .top .iovo-sea-picker { flex: none !important; order: 2 !important; gap: 0 !important; min-width: 0 !important; min-height: 36px !important; }
  .top .iovo-sea-picker .iovo-sea-seg--fx { display: none !important; }
  .top .iovo-sea-picker .iovo-sea-seg {
    padding: 3px !important;
    gap: 1px !important;
    border-radius: 999px !important;
    height: 36px !important;
  }
  .top .iovo-sea-picker [data-sea-theme] {
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-size: 0 !important;
    color: var(--text-2);
  }
  .top .iovo-sea-picker [data-sea-theme]::before {
    content: "";
    display: block;
    width: 15px;
    height: 15px;
    flex: none;
    background-color: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
  .top .iovo-sea-picker [data-sea-theme="aqua"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202.8C12%202.8%205.5%2010.6%205.5%2014.8a6.5%206.5%200%200%200%2013%200C18.5%2010.6%2012%202.8%2012%202.8Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202.8C12%202.8%205.5%2010.6%205.5%2014.8a6.5%206.5%200%200%200%2013%200C18.5%2010.6%2012%202.8%2012%202.8Z'/%3E%3C/svg%3E");
  }
  .top .iovo-sea-picker [data-sea-theme="light"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%207a5%205%200%201%200%200%2010%205%205%200%200%200%200-10ZM12%202v2M12%2020v2M4.93%204.93l1.41%201.41M17.66%2017.66l1.41%201.41M2%2012h2M20%2012h2M4.93%2019.07l1.41-1.41M17.66%206.34l1.41-1.41'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%207a5%205%200%201%200%200%2010%205%205%200%200%200%200-10ZM12%202v2M12%2020v2M4.93%204.93l1.41%201.41M17.66%2017.66l1.41%201.41M2%2012h2M20%2012h2M4.93%2019.07l1.41-1.41M17.66%206.34l1.41-1.41'/%3E%3C/svg%3E");
  }
  .top .iovo-sea-picker [data-sea-theme="dark"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20.5%2014.2A8.5%208.5%200%200%201%209.8%203.5a8.5%208.5%200%201%200%2010.7%2010.7Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20.5%2014.2A8.5%208.5%200%200%201%209.8%203.5a8.5%208.5%200%201%200%2010.7%2010.7Z'/%3E%3C/svg%3E");
  }
  .top .iovo-sea-picker [data-sea-theme][aria-pressed="true"] {
    background: var(--accent) !important;
    color: var(--accent-ink) !important;
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 44%, transparent) !important;
  }

  /* Account: circular avatar only, never clipped */
  .top .ceo-account-trigger {
    flex: none !important;
    order: 4 !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 999px !important;
    justify-content: center !important;
  }
  .top > .tools .ceo-account-trigger__name,
  .top > .tools .ceo-account-trigger__chevron { display: none !important; }

  /* Explicit flex row break between Row 1 (orders 0..4) and Row 2 (orders 5..6) across 360px..768px */
  .top:has(.reporting-period:not([hidden]), > .ceo-tabs:not([hidden]))::after {
    content: "";
    flex: 1 0 100%;
    order: 4;
    height: 0;
    margin-top: -6px;
  }

  /* Row 2: Reporting period + Command | AI Team toggle side-by-side on one compact glass row */
  .top .reporting-period:not([hidden]) {
    order: 5 !important;
    flex: 1 1 0 !important;
    display: flex !important;
    min-width: 118px !important;
    margin: 2px 0 0 !important;
  }
  .top:not(:has(> .ceo-tabs:not([hidden]))) .reporting-period:not([hidden]) {
    flex: 1 0 100% !important;
  }
  .top .reporting-period .gsel-wrap,
  .top .reporting-period .gsel,
  .top .reporting-period select {
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    border-radius: 999px !important;
    font-size: 12.5px !important;
  }
  .top .reporting-period select { padding: 0 26px 0 12px !important; }

  /* CEO Command / AI Team tabs: crisp Apple Glass pill strip directly beside Reporting Period on Row 2 */
  .top > .ceo-tabs:not([hidden]) {
    order: 6 !important;
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 100%;
    margin: 2px 0 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    height: 36px !important;
    min-height: 36px !important;
    padding: 3px !important;
    border-radius: 999px !important;
    background: var(--glass-solid);
    border: 1px solid var(--line-soft);
    box-sizing: border-box;
  }
  .top:not(:has(.reporting-period:not([hidden]))) > .ceo-tabs:not([hidden]) {
    flex: 1 0 100% !important;
  }
  .top:not(:has(.reporting-period:not([hidden]))) > .ceo-tabs:not([hidden]) .ceo-tab {
    flex: 1 1 0 !important;
  }
  .top > .ceo-tabs:not([hidden]) .ceo-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
    font-weight: 650;
    white-space: nowrap;
    border-radius: 999px !important;
  }

  /* ---- body ---- */
  main { padding: 10px 12px calc(108px + env(safe-area-inset-bottom, 0px)) !important; max-width: 100%; overflow-x: hidden; }
  .dash { display: flex !important; flex-direction: column !important; gap: 12px !important; min-height: 0 !important; }
  .kband, .river, .mid, .side, .foot { min-width: 0; max-width: 100%; }

  /* ---- 2x2 money cards: icon + label left, chevron pinned right, figure and note left-aligned ---- */
  .kpis:not(:empty) + .sk-row,
  .cols:not(:empty) + .sk-row,
  .bottom:not(:empty) + .sk-row { display: none !important; }
  .kpis { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .kpis-sk { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  html body #main .kband .kpi.pv,
  .kpi, .kpi-sk {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    min-height: 0 !important;
    padding: 9px 11px !important;
    border-radius: 14px !important;
    overflow: hidden;
    text-align: left !important;
  }
  html body #main .kband .kpi.pv .lab {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }
  html body #main .kband .kpi.pv .lab .kic { display: grid !important; place-items: center !important; flex: none !important; width: 22px !important; height: 22px !important; margin: 0 !important; border-radius: 7px !important; }
  html body #main .kband .kpi.pv .lab .kic .ic, html body #main .kband .kpi.pv .lab .kic svg { --ic-size: 13px; width: 13px !important; height: 13px !important; }
  html body #main .kband .kpi.pv .lab .kl {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 12.5px !important;
    font-weight: 650 !important;
    text-align: left !important;
  }
  html body #main .kband .kpi.pv .lab .chev {
    position: static !important;
    inset: auto !important;
    flex: none !important;
    margin: 0 0 0 auto !important;
    opacity: .6;
    line-height: 0;
  }
  html body #main .kband .kpi.pv .lab .chev .i,
  html body #main .kband .kpi.pv .lab .chev svg { width: 14px; height: 14px; }
  html body #main .kband .kpi.pv .kpi-body { display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 3px !important; min-width: 0 !important; width: 100% !important; text-align: left !important; }
  html body #main .kband .kpi.pv .kpi-main { display: flex !important; align-items: baseline !important; justify-content: flex-start !important; gap: 6px !important; min-width: 0 !important; width: 100% !important; }
  html body #main .kband .kpi.pv .kpi-val-wrap { display: flex !important; align-items: baseline !important; flex-wrap: wrap !important; gap: 4px 6px !important; min-width: 0 !important; }
  html body #main .kband .kpi.pv .v,
  .kpi .kv { font-size: clamp(19px, 5.2vw, 22px) !important; line-height: 1.1 !important; font-weight: 750 !important; white-space: nowrap; text-align: left !important; }
  html body #main .kband .kpi.pv .d,
  html body #main .kband .kpi.pv .d span,
  .kpi .kd {
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: hidden !important;
    max-width: 100% !important;
    text-align: left !important;
    color: var(--text-2);
  }
  html body #main .kband .kpi.pv .d { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; }
  html body #main .kband .kpi.pv svg.spark { display: none !important; }

  /* ---- Pipeline River on a phone (owner, Scrawl 19): dedicated LEFT luminous vertical river spine
     with glowing numbered stage orbs 1..8, subtle swimming fish & pulsing amber bottleneck eddies,
     paired with crisp aligned glass stage rows on the RIGHT — ZERO text crossing the river curve. ---- */
  html body #main .card.river { padding: 12px 12px !important; gap: 8px !important; overflow: hidden; border-radius: 16px !important; }
  html body #main .river .ch { flex-wrap: wrap !important; align-items: center !important; gap: 4px 8px !important; padding: 0 !important; min-height: 0 !important; }
  html body #main .river .ch > h2 { font-size: 17px !important; line-height: 1.2 !important; margin: 0 !important; }
  html body #main .river .eyebrow { flex-basis: 100%; margin: 0 !important; font-size: 9.5px !important; letter-spacing: .14em; }
  html body #main .river .rlegend { margin: 0 !important; flex-wrap: wrap !important; gap: 4px 12px !important; font-size: 12px; }
  html body #main .river .rv { position: relative !important; min-height: 0 !important; padding: 0 !important; overflow: visible !important; display: flex !important; flex-direction: column !important; gap: 8px !important; }
  html body #main .river .rv > .rv-water,
  html body #main .river .rv > #rvNet,
  html body #main .river .rv > .stages,
  html body #main .river .rv > .stages-sk { min-width: 0 !important; }
  html body #main .river #rvNet {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: 34px !important;
    bottom: 0 !important;
    width: 58px !important;
    height: calc(100% - 34px) !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
  html body #main .river .rv:not(:has(.rv-water .flag)) #rvNet { top: 0 !important; height: 100% !important; }
  html body #main .river .rv-chan,
  html body #main .river .rnode,
  html body #main .river .rpin { display: none !important; }
  html body #main .river .rv-water { position: relative !important; z-index: 3 !important; height: auto !important; display: flex !important; flex-wrap: wrap !important; gap: 5px !important; pointer-events: auto !important; }
  html body #main .river .rv-water:not(:has(.flag)) { display: none !important; }
  html body #main .river .rv-water .flag { position: static !important; left: auto !important; transform: none !important; max-width: 100% !important; height: 24px !important; padding: 0 9px !important; font-size: 11px !important; }
  html body #main .river .stages:not(:empty) + .stages-sk { display: none !important; }
  html body #main .river .stages,
  html body #main .river .stages-sk {
    position: relative !important; z-index: 2 !important; display: flex !important; flex-direction: column !important; gap: 7px !important;
    margin: 0 !important; padding: 4px 0 6px !important; background: none !important;
  }
  html body #main .river .stages::before,
  html body #main .river .stages::after { display: none !important; }
  html body #main .river .stages > li { position: relative !important; display: block !important; min-width: 0 !important; z-index: 2; }
  html body #main .river .stages > li.bn { --rv-node: var(--warn); }
  /* Clean 1-to-1 left-spine river + aligned right glass stage rows (Scrawl 19):
     Column 1 (48px): glowing numbered orb riding the vertical left river spine.
     Columns 2..4: crisp glass row backdrop (::before) holding Stage Name + Sub-status | Count | ›. */
  html body #main .river .stages button {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) auto 14px !important;
    grid-template-rows: auto auto !important;
    justify-items: start !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 2px !important;
    width: 100% !important;
    min-height: 54px;
    height: auto !important;
    padding: 8px 12px 8px 4px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left !important;
    isolation: isolate;
  }
  html body #main .river .stages button::before {
    content: "";
    position: absolute;
    left: 52px;
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 13px;
    background: var(--glass-hi);
    border: 1px solid var(--line-soft);
    z-index: -1;
    pointer-events: none;
    transition: border-color .18s ease, background .18s ease;
  }
  html body #main .river .stages > li.bn > button::before {
    background: linear-gradient(90deg, var(--warn-soft), var(--glass-hi) 68%);
    border-color: color-mix(in srgb, var(--warn) 44%, var(--line-soft));
  }
  html body #main .river .stages button:active::before {
    border-color: var(--rv-node, var(--accent));
  }
  html body #main .river .stages button .sh { display: contents !important; }
  html body #main .river .stages button .num {
    grid-column: 1; grid-row: 1 / 3; justify-self: center; width: 30px !important; height: 30px !important; margin: 0 !important;
    transform: translateX(var(--orb-x, 0px));
    border-radius: 50%; border: 2px solid var(--rv-node) !important; font-size: 12.5px !important; font-weight: 800; color: var(--platform-ink, var(--text));
    background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.72), transparent 44%), color-mix(in srgb, var(--rv-node) 34%, var(--rv-chip, var(--glass-solid))) !important;
    box-shadow: 0 0 14px color-mix(in srgb, var(--rv-node) 76%, transparent), inset 0 1px 2px rgba(255,255,255,.55) !important; text-shadow: none !important;
  }
  html body #main .river .stages button .sn { grid-column: 2; grid-row: 1; min-width: 0; max-width: 100% !important; padding-left: 8px; font-size: 14px !important; line-height: 1.2 !important; font-weight: 700; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  html body #main .river .stages button .sl.queue-label { grid-column: 2; grid-row: 2; margin: 0 !important; padding-left: 8px; font-size: 11.5px !important; line-height: 1.2 !important; font-weight: 550; color: var(--text-2); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  html body #main .river .stages button .sv { grid-column: 3; grid-row: 1 / 3; justify-self: end; margin: 0 !important; font-size: 19px !important; line-height: 1 !important; font-weight: 800; font-variant-numeric: tabular-nums; }
  html body #main .river .stages button .sv.none { font-size: 11.5px !important; white-space: normal !important; text-align: right; }
  html body #main .river .stages button::after { content: "\203A"; grid-column: 4; grid-row: 1 / 3; justify-self: end; font-size: 18px; line-height: 1; color: var(--platform-muted, var(--text-3)); opacity: .75; }
  html body #main .river .stages button:disabled::after { content: none; }

  /* Subtle organic micro-ripple inside the left 48px river channel (never crosses into the right glass cards). */
  html body #main .river .stages > li:nth-child(odd) { --orb-x: -2px; }
  html body #main .river .stages > li:nth-child(even) { --orb-x: 2px; }

  html body #main .river .stages li.bn button .num { animation: ceo-river-pool 2.4s ease-out infinite; }
  @keyframes ceo-river-pool {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 60%, transparent), 0 0 14px color-mix(in srgb, var(--warn) 80%, transparent), inset 0 1px 2px rgba(255,255,255,.55); }
    70% { box-shadow: 0 0 0 9px transparent, 0 0 16px color-mix(in srgb, var(--warn) 55%, transparent), inset 0 1px 2px rgba(255,255,255,.55); }
    100% { box-shadow: 0 0 0 0 transparent, 0 0 14px color-mix(in srgb, var(--warn) 80%, transparent), inset 0 1px 2px rgba(255,255,255,.55); }
  }
  @media (prefers-reduced-motion: reduce) {
    html body #main .river .stages li.bn button .num { animation: none; }
  }

  /* Card header icons: refined 26px chips across cards, panels and department blocks. */
  html body #main :is(.card, .panel, .dept) .ch > .ico,
  html body #main .ach > .ic-badge { width: 26px !important; height: 26px !important; min-width: 26px !important; margin: 0 !important; border-radius: 8px !important; flex: none !important; }
  html body #main :is(.card, .panel, .dept) .ch > .ico .ic,
  html body #main .ach > .ic-badge .ic { --ic-size: 14px; width: 14px !important; height: 14px !important; }

  /* ---- Mid section: Map + Live Verification + Watchlist stack cleanly ---- */
  .mid { display: flex !important; flex-direction: column !important; gap: 12px !important; }
  /* US Installation & Service Map (owner, Scrawl 8): compact header and a stats strip ABOVE the map, the map itself
     unobstructed, "Zoom to installs" tucked bottom-left (clear of AQUIS / Dive on the right). */
  html body #main .card.atlas { position: relative !important; display: flex !important; flex-direction: column !important; gap: 8px !important; height: auto !important; min-height: 0 !important; padding: 12px !important; overflow: hidden; border-radius: 16px !important; }
  html body #main .atlas .ach {
    position: static !important; order: -1; width: 100% !important; height: auto !important; inset: auto !important; padding: 0 !important; margin: 0 !important;
    display: grid !important; grid-template-columns: 26px minmax(0, 1fr); align-items: center !important; gap: 6px 8px !important; background: none !important; pointer-events: auto !important;
  }
  html body #main .atlas .ach > .ic-badge { grid-column: 1; grid-row: 1; }
  html body #main .atlas .ach > h2 { grid-column: 2; grid-row: 1; margin: 0 !important; padding-right: 96px; font-size: 15.5px !important; line-height: 1.2 !important; }
  html body #main .atlas .ach > .sub { grid-column: 1 / -1; grid-row: 2; order: 0 !important; width: auto !important; max-width: 100% !important; min-height: 0 !important; margin: 0 !important; padding-right: 78px !important; box-sizing: border-box !important; display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 5px !important; font-size: 11.5px !important; }
  html body #main .atlas .ach > .sub > .sep { display: none !important; }
  html body #main .atlas .ach > .sub > span { flex: none !important; min-height: 0 !important; height: 24px; display: inline-flex !important; align-items: center; gap: 4px; padding: 0 9px !important; border-radius: 999px !important; border: 1px solid var(--line-soft) !important; background: var(--glass-solid) !important; white-space: nowrap; }
  html body #main .atlas .ach > .alegend { grid-column: 1 / -1; grid-row: 3; margin: 0 !important; display: flex !important; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; }
  html body #main .atlas .ach > .fit { position: absolute !important; left: 22px !important; right: auto !important; top: auto !important; bottom: 22px !important; margin: 0 !important; z-index: 6; }
  html body #main .atlas .map { position: relative !important; order: 2; height: 230px !important; min-height: 230px !important; border-radius: 12px; overflow: hidden; }
  html body #main .atlas .atlas-expand { top: 8px !important; right: 8px !important; }
  .cols, .bottom { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  .cols-sk, .bottom-sk { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }

  /* Watch list (Scrawl 9): condensed unified glass list instead of 5 chunky spaced boxes. */
  html body #main .decide { padding: 12px !important; border-radius: 16px !important; }
  html body #main .decide .ch { margin-bottom: 8px !important; }
  html body #main .decide .decisions {
    gap: 0 !important;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    overflow: hidden;
    background: var(--glass-hi);
  }
  html body #main .decide .decision {
    margin-inline: 0 !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 6px 10px !important;
    gap: 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  html body #main .decide .decision + .decision { border-top: 1px solid var(--line-soft) !important; }
  html body #main .decide .decision.hot { background: linear-gradient(90deg, var(--warn-soft), transparent 72%) !important; }
  html body #main .decide .decision .dico { width: 26px !important; height: 26px !important; border-radius: 8px !important; }
  html body #main .decide .decision .dico .ic { --ic-size: 14px; width: 14px !important; height: 14px !important; }
  html body #main .decide .decision .dt { align-items: center !important; gap: 2px 8px !important; }
  html body #main .decide .decision .dt b { font-size: 16px !important; min-width: 28px !important; }
  html body #main .decide .decision .dt span { font-size: 12.5px !important; line-height: 1.25 !important; }
  .verify.pv .call { min-height: 44px; }
  dialog#records {
    inset: auto 0 0 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 88dvh !important;
    max-height: 88dvh !important;
    border-radius: 22px 22px 0 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  dialog#records .drill { display: flex !important; flex-direction: column !important; overflow-y: auto; }
  dialog#records .dw-table-wrap, dialog#records #record-content { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  /* Compact phone drawer: hide blank Case ref column (when desktop office links are hidden) & avoid duplicate KPI title/value strip. */
  dialog#records .dw-table th.ref, dialog#records .dw-table tbody tr > td:first-child:not([colspan]) { display: none !important; }
  dialog#records .dw-table th.cust { width: 34% !important; }
  dialog#records .dw-table th.own { width: 42% !important; }
  dialog#records .dw-table th.val { width: 24% !important; }
  dialog#records #record-sum .ds-name, dialog#records #record-sum .ds-big, dialog#records #record-sum .ds-scope { display: none !important; }
  dialog#records #record-sum { padding: 8px 14px !important; }

  /* AQUIS (Scrawl 19): ONLY the canonical aquis-orb.js orb sits bottom-right on CEO Command mobile;
     hide stray floating Dive button above AQUIS so there is zero clutter above the orb. */
  html:root:root body #aquis#aquis[data-aquis-mark]:not(#_),
  html:root:root body #aquis#aquis[data-aquis-mark]:not(#_) .orb-cv { width: 70px !important; height: 81px !important; }
  html:root:root body #aquis#aquis[data-aquis-mark]:not(#_) { right: 8px !important; bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important; }
  html:root:root body #ceo-dive#ceo-dive:not(#_),
  .ceo-dive,
  .iovo-sea-dive-btn { display: none !important; }
  html[data-theme="light"] .top > .tools .iovo-sea-picker [data-sea-theme][aria-pressed="true"] { color: #ffffff !important; }
  #aquis[data-aquis-mark] {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* ---- AI Team / Agent Views on mobile (Scrawl 19 + Scrawl 22 universal 999px pills) ---- */
  html[data-theme="dark"] .top > .ceo-tabs:not([hidden]) .ceo-tab[aria-selected="true"] {
    background: color-mix(in srgb, #f47920 22%, rgba(28, 18, 12, .92)) !important;
    border-color: rgba(244, 121, 32, .52) !important;
    color: #fff3e6 !important;
  }

  .ai-team-view {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    gap: 10px !important;
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .ai-subbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 0 !important;
  }
  .ai-kpi-strip {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100%;
  }
  .ai-kpi {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    padding: 9px 11px !important;
    border-radius: 13px !important;
    background: var(--glass-hi);
    border: 1px solid var(--line-soft);
    font-size: 11px !important;
    min-width: 0;
  }
  .ai-kpi strong { font-size: 17px !important; line-height: 1.15; }
  html[data-theme="dark"] .ai-kpi strong.em,
  html[data-theme="dark"] .ai-kpi strong.bl { color: #ff9a4d; }
  .ai-refresh-note {
    justify-content: space-between;
    font-size: 11px;
    padding: 0 2px;
  }

  /* Agent cards: crisp stacked mobile glass cards with compact orbs & clean metrics */
  .ai-stage {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 0 !important;
  }
  .ai-agent {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px 14px !important;
    border-radius: 16px !important;
    background: var(--glass) !important;
    border: 1px solid var(--line-soft) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    overflow: hidden;
  }
  .ai-agent.is-active {
    border-color: color-mix(in srgb, var(--accent, #5ce6f2) 45%, var(--line-soft)) !important;
  }
  html[data-theme="dark"] .ai-agent.is-active {
    border-color: rgba(244, 121, 32, .48) !important;
  }
  .ai-agent::before { width: 180px; height: 180px; top: -24px; }
  .ai-orb-wrap { width: 168px !important; height: 108px !important; }
  .ai-whisper { max-width: calc(100% - 16px); font-size: 10.5px; }
  .ai-name { margin-top: 4px; font-size: 16.5px !important; }
  .ai-role { font-size: 11.5px; }
  .ai-status-row { margin-top: 6px; gap: 5px; }
  .ai-hero { margin-top: 6px; }
  .ai-hero strong { font-size: 22px !important; }
  .ai-bar { width: 100% !important; max-width: 100%; }
  .ai-legend { gap: 6px 10px; font-size: 11px; }
  .ai-mini-stats { width: 100% !important; max-width: 100%; margin-top: 8px; padding-top: 8px; }
  .ai-listen-bar { width: 100%; margin-top: 8px; }
  .ai-listen-btn { min-height: 44px; padding: 6px 13px; font-size: 12px; }
  .ai-cta { margin-top: 8px; min-height: 44px; padding: 4px 12px; display: inline-flex; align-items: center; }
  html[data-theme="dark"] .ai-agent .ai-cta b { color: #ff9a4d; }

  /* Bottom 3-Panel Dock stacked cleanly on mobile */
  .ai-dock {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    height: auto !important;
  }
  .ai-panel {
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }
  .ai-panel-hd { flex-wrap: wrap; gap: 6px 8px; margin-bottom: 8px; }
  .ai-filters { flex-wrap: wrap; gap: 4px; }
  .ai-flt { min-height: 44px; padding: 4px 10px; font-size: 11.5px; }
  .ai-list { max-height: 280px; }
  .ai-call-row {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 6px 8px !important;
    padding: 8px 10px !important;
    min-height: 44px;
  }
  .ai-row-cta { display: none; }
  .ai-esc-card { min-height: 44px; padding: 9px 11px; }
  .ai-maya-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .ai-maya-btn { min-height: 44px; display: inline-flex; align-items: center; }

  /* AI Agent slide-over drawer -> Apple-native bottom sheet on mobile (ZERO logo on drawers/modals) */
  .ai-drawer {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 86dvh !important;
    max-height: 86dvh !important;
    border-radius: 22px 22px 0 0 !important;
    border-bottom: 0 !important;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
    box-shadow: 0 -20px 56px rgba(0, 0, 0, .65) !important;
  }
  .ai-dr-top { align-items: center; padding-bottom: 10px; }
  .ai-dr-title { font-size: 17px; }
  .ai-dr-x { width: 44px !important; height: 44px !important; font-size: 20px; }
  .ai-dr-card { padding: 11px 12px; }
  .ai-dr-row { padding: 9px 10px; }
  .ai-dr-row-top { flex-wrap: wrap; gap: 4px 8px; }
  .ai-dr-close-btn { min-height: 44px; padding: 8px 18px; font-size: 13px; }
}
