/* Fleet mobile — premium SaaS layout (~390px). Desktop styles stay untouched. */

@media (max-width: 767px) {
  /* ---------- Page canvas ---------- */
  body:has(.main--fleet),
  .app:has(.main--fleet) {
    background: var(--bg);
  }

  .main.main--fleet,
  .main--fleet {
    background: var(--bg);
    padding: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .fleet-page,
  .fleet {
    background: transparent !important;
    gap: 0;
  }

  .fleet-control-deck {
    background: transparent !important;
    border-bottom: none !important;
    z-index: 5;
    gap: 0;
    padding: 0 16px 8px !important;
  }

  /* Desktop page head lives in the mobile top bar now */
  .fleet .page-head,
  .fleet .page-head--fleet {
    display: none !important;
  }

  /* ---------- Mobile top bar ---------- */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: calc(var(--z-sidebar) + 5);
    height: calc(48px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  body.is-workspace-view .mobile-top-bar,
  .app.is-workspace .mobile-top-bar {
    display: none !important;
  }

  .mobile-top-bar__left,
  .mobile-top-bar__right {
    display: flex;
    align-items: center;
    min-width: 0;
  }
  .mobile-top-bar__left { gap: 8px; min-width: 0; flex: 1 1 auto; }
  .mobile-top-bar__right {
    gap: 6px;
    flex: 0 0 auto;
    max-width: none;
  }
  .mobile-top-bar__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-top-bar__account {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
  }

  .mobile-top-bar__balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    padding: 2px 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1.1;
    color: inherit;
    flex: 0 0 auto;
  }
  .mobile-top-bar__balance[hidden] { display: none !important; }
  .mobile-top-bar__balance-label {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
  }
  .mobile-top-bar__balance-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }

  .mobile-top-bar__add-funds {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .mobile-top-bar__add-funds:active { background: var(--hover); }
  .mobile-top-bar__add-funds[hidden] { display: none !important; }

  .mobile-top-bar__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0;
    flex: none;
    cursor: pointer;
  }
  .mobile-top-bar__icon-btn .icon { width: 16px; height: 16px; }
  .mobile-top-bar__icon-btn:active { background: var(--hover); }

  .mobile-top-bar__create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: var(--text-on-blue);
    padding: 0;
    flex: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  }
  .mobile-top-bar__create .icon { width: 20px; height: 20px; }
  .mobile-top-bar__create:active { background: var(--primary-active); }
  .mobile-top-bar__create[hidden] { display: none !important; }

  .content.app-main,
  .app-main {
    padding-top: calc(48px + env(safe-area-inset-top, 0px)) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .app.is-workspace .content.app-main,
  .app.is-workspace .app-main,
  body.is-workspace-view .content.app-main,
  body.is-workspace-view .app-main {
    padding-top: env(safe-area-inset-top, 0px) !important;
  }

  /* Hide legacy brand-centered top bar pieces */
  .mobile-top-bar__brand { display: none !important; }

  /* ---------- Search ---------- */
  .fleet .command-bar {
    padding: 6px 0 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .fleet .command-bar__row--search {
    padding: 0;
    margin-bottom: 6px;
  }
  .fleet .search-box {
    position: relative;
    height: 32px;
    max-width: none !important;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }
  .fleet .search-box__icon {
    left: 10px;
    color: var(--icon-muted);
  }
  .fleet .search-box__icon .icon { width: 13px; height: 13px; }
  .fleet .search-box__input {
    height: 32px;
    line-height: 32px;
    padding: 0 10px 0 32px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
    box-shadow: none;
  }
  .fleet .search-box__input::placeholder {
    color: var(--input-placeholder);
    font-weight: 400;
  }
  .fleet .search-box__input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
    background: var(--surface);
    outline: none;
  }

  /* ---------- Group selector (replaces tab strip) ---------- */
  .fleet-control-deck__nav-row--groups {
    min-height: 0 !important;
    max-height: none !important;
  }
  .fleet-control-deck__groups,
  #device-group-bar,
  .device-group-navigator {
    display: none !important;
  }

  /* ---------- Mobile toolbar (Groups · Filters · Sort · More) ---------- */
  .fleet-m-toolbar {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
  }
  .fleet-m-toolbar[hidden] {
    display: none !important;
  }
  .fleet-m-toolbar__row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .fleet-m-toolbar__row::-webkit-scrollbar {
    display: none;
  }
  .fleet-m-dd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    font-weight: 450;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    justify-content: flex-start;
    flex: none;
  }
  .fleet-m-dd .icon:first-child {
    width: 13px;
    height: 13px;
    color: var(--icon-secondary);
    flex: none;
  }
  .fleet-m-dd .icon:last-child {
    width: 11px;
    height: 11px;
    color: var(--icon-muted);
    flex: none;
    margin-left: 0;
  }
  .fleet-m-dd__text {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 11px;
    font-weight: 450;
    letter-spacing: -0.01em;
  }
  .fleet-m-dd--groups {
    flex: 1 1 0;
    width: 0;
    max-width: 100%;
    padding: 0 7px;
    font-size: 10px;
  }
  .fleet-m-dd--groups .fleet-m-dd__text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    letter-spacing: -0.02em;
  }
  .fleet-m-dd--compact {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0 8px;
    gap: 4px;
  }
  #btn-filters-m {
    flex: 0 0 auto;
  }
  #btn-sort-m {
    flex: 0 0 auto;
  }
  .fleet-m-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 36px;
    margin: 0 0 0 -2px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .fleet-m-more-btn .icon {
    width: 16px;
    height: 16px;
    margin: 0;
  }
  .fleet-m-more-btn:active {
    background: var(--hover);
  }
  .fleet-m-dd.is-active {
    border-color: var(--blue-border-soft);
    background: var(--blue-soft);
    color: var(--blue);
  }
  .fleet-m-dd.is-active .icon:first-child { color: var(--blue); }
  #filter-badge-m { display: none !important; }

  /* ---------- Status chips ---------- */
  .fleet-control-deck__nav {
    border-top: none !important;
    gap: 0;
    padding: 6px 0 0;
    margin: 0;
  }
  .fleet-control-deck__nav-row--quick {
    border-top: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    overflow: visible;
  }
  .quick-filter-bar {
    overflow: hidden;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
  .quick-filter-bar__track {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    /* Room so the last chip (Expired) isn’t clipped at the edge */
    padding-right: 12px;
    margin-right: -4px;
  }
  .quick-filter-bar__track::-webkit-scrollbar { display: none; }
  .quick-filter-bar__items {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 5px !important;
    padding: 0;
    width: max-content !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
  }
  .quick-filter-bar__overflow { display: none !important; }

  .quick-filter-chip {
    height: 28px;
    padding: 0 7px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 10.5px;
    font-weight: 450;
    gap: 3px;
    box-shadow: none;
    color: var(--text);
    flex: 0 0 auto !important;
    white-space: nowrap;
    max-width: none;
  }
  .quick-filter-chip__dot {
    width: 5px;
    height: 5px;
    flex: none;
  }
  .quick-filter-chip__ico,
  .quick-filter-chip__icon {
    width: 11px;
    height: 11px;
    flex: none;
  }
  .quick-filter-chip__ico .icon,
  .quick-filter-chip__icon .icon {
    width: 11px;
    height: 11px;
  }
  .quick-filter-chip--ok .quick-filter-chip__dot { background: var(--ok); }
  .quick-filter-chip--danger .quick-filter-chip__dot { background: var(--danger); }
  .quick-filter-chip--warn .quick-filter-chip__dot { background: var(--warn); }
  .quick-filter-chip__label {
    font-weight: 450;
  }
  .quick-filter-chip__count {
    font-weight: 450;
    font-variant-numeric: tabular-nums;
  }
  .quick-filter-chip.is-active {
    border-color: var(--blue-border-soft);
    background: var(--blue-soft);
    color: var(--blue);
  }

  /* ---------- Device list region ---------- */
  .device-list-region {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }
  .device-list-collection {
    background: transparent;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  .mobile-select-bar[hidden] {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
  }
  [data-layout="mobile"] .fleet[data-mview="cards"] #mobile-list-root,
  [data-layout="mobile"] .fleet:not([data-mview]) #mobile-list-root {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
  [data-layout="mobile"] .mobile-device-list__end:empty,
  [data-layout="mobile"] .mobile-device-list__end.is-empty {
    display: block !important;
    height: 1px !important;
    min-height: 1px !important;
    max-height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
  }
  [data-layout="mobile"] .mobile-device-list__end:not(:empty):not(.is-empty) {
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    opacity: 1;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  /* Mobile swipeable list — full-bleed table, scroll only inside table viewport */
  [data-layout="mobile"] .main--fleet:has(.fleet[data-mview="list"]) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] .fleet-control-deck {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] .device-list-region {
    width: 100%;
    max-width: none;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: var(--surface) !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] .device-list-collection {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    overflow: hidden !important;
    touch-action: manipulation;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root:not([hidden]) {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 0 !important;
    margin: 0;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] .fleet-page,
  [data-layout="mobile"] .fleet[data-mview="list"] .fleet {
    width: 100%;
    max-width: none;
    min-height: 0;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .device-table-scroll,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: auto !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: contain;
    touch-action: pan-x pan-y;
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    isolation: isolate;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .table-end {
    flex: none;
    border: none;
    background: var(--surface);
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .table-end[hidden] {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive {
    width: max-content;
    min-width: 0;
    table-layout: fixed;
    --row-h: 72px;
    --cell-py: 10px;
    --cell-stack-gap: 3px;
    --cell-px: 8px;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root col[data-col="device"] {
    width: 156px !important;
    min-width: 156px !important;
    max-width: 168px !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table thead th.col-device,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-device {
    width: 156px !important;
    min-width: 156px !important;
    max-width: 168px !important;
    padding-right: 8px !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-device .device-name-link,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-device .device-cell__hardware {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
  }
  /* Current IP: header + address + actions share one left edge (stacked column). */
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table thead th.col-currentIp .th-inner {
    justify-content: flex-start;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-currentIp {
    vertical-align: middle;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-currentIp .ip-cell {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--cell-stack-gap, 3px);
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-currentIp .ip-cell__addr {
    text-align: left;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table {
    font-size: 11px;
  }
  /* Scroll all columns together — no horizontal sticky (prevents device overlap on swipe) */
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td.col-check,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td.col-rail,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td.col-device,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td.col-actions {
    position: static !important;
    left: auto !important;
    right: auto !important;
    box-shadow: none !important;
    z-index: auto !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table thead th {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    z-index: 3 !important;
    background: var(--surface-2);
    box-shadow: none;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td.col-device,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table--adaptive tbody td.col-device .device-cell {
    overflow: hidden;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #mobile-list-root {
    display: none !important;
  }

  .mobile-device-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px 14px;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
  }
  .mobile-device-list > .state-box {
    grid-column: 1 / -1;
  }

  /* ---------- Device cards (2-column grid) ---------- */
  .mobile-device-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    min-height: 0;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.05),
      0 4px 12px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    isolation: isolate;
  }
  .mobile-device-item.is-selected {
    border-color: var(--blue-border);
    background: var(--selected);
    box-shadow:
      0 0 0 1px var(--blue-border-soft),
      0 4px 12px rgba(37, 99, 235, 0.1);
  }

  .mobile-device-item__top {
    display: block;
    position: relative;
    min-width: 0;
    padding: 10px 28px 8px 10px;
  }
  .mobile-device-item__identity {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    width: 100%;
  }
  .mobile-device-item__status {
    width: auto;
    padding-top: 4px;
    flex: none;
  }
  .mobile-device-item__status .status {
    gap: 0;
  }
  .mobile-device-item__status .status__dot,
  .mobile-device-item__status .ov-health__dot {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
  }
  /* Agreed mobile colors: green / red / orange */
  .mobile-device-item__status .status--online .status__dot,
  .mobile-device-item__status .status--active .status__dot {
    background: var(--ok) !important;
  }
  .mobile-device-item__status .status--offline .status__dot,
  .mobile-device-item__status .status--disabled .status__dot,
  .mobile-device-item__status .status--error .status__dot,
  .mobile-device-item__status .status--suspended .status__dot {
    background: var(--danger) !important;
  }
  .mobile-device-item__status .status--expired .status__dot {
    background: var(--warn) !important;
    border: none !important;
    width: 8px !important;
    height: 8px !important;
  }
  .mobile-device-item__status .status--warning .status__dot,
  .mobile-device-item__status .status--connecting .status__dot,
  .mobile-device-item__status .status--reconnecting .status__dot,
  .mobile-device-item__status .status--rotating .status__dot {
    background: var(--ok) !important;
    animation: none !important;
  }
  .mobile-device-item__title {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-device-item__name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.3;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    text-decoration: none;
  }
  .mobile-device-item__name:hover {
    color: var(--blue);
  }
  .mobile-device-item__model {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
  }
  .mobile-device-item__net {
    font-size: 10px;
    font-weight: 450;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
  }
  .mobile-device-item__actions {
    display: inline-flex;
    align-items: center;
    flex: none;
    position: absolute;
    top: 6px;
    right: 4px;
    z-index: 1;
  }
  .mobile-device-item__actions .icon-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--icon-secondary);
    padding: 0;
  }
  .mobile-device-item__actions .icon-btn .icon {
    width: 14px;
    height: 14px;
  }

  .mobile-device-item__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    border-top: 1px solid var(--border-soft);
    margin: 0;
  }
  .mobile-device-item__metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 7px 2px;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    position: relative;
    text-align: center;
  }
  .mobile-device-item__metric:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border-soft);
  }
  .mobile-device-item__metric-val {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
  }
  .mobile-device-item__metric-val .icon {
    width: 11px;
    height: 11px;
    color: var(--icon-secondary);
    flex: none;
  }
  .mobile-device-item__metric-val.is-empty {
    color: var(--text-muted);
    font-weight: 500;
  }
  .mobile-device-item__metric-val.device-battery--warn { color: var(--warn); }
  .mobile-device-item__metric-val.device-battery--danger { color: var(--danger); }
  .mobile-device-item__metric-label {
    font-size: 9px;
    font-weight: 450;
    color: var(--text-muted);
    line-height: 1.1;
  }

  .mobile-device-item__metric .port-expiry-summary {
    font-size: 9px;
    gap: 2px;
    line-height: 1.1;
  }

  .mobile-device-item__expire {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 7px 8px;
    background: var(--surface-2);
    border-top: 1px solid var(--border-soft);
    font-size: 10px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.25;
  }
  .mobile-device-item__expire .icon {
    width: 10px;
    height: 10px;
    flex: none;
    color: var(--icon-muted);
  }
  .mobile-device-item__expire > span {
    min-width: 0;
    flex: 1 1 auto;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-weight: 400;
  }
  .mobile-device-item__expire .lifecycle-expiry {
    color: inherit;
    font-size: inherit;
    font-weight: 400;
  }
  .mobile-device-item__expire .lifecycle-expiry.expiry--danger,
  .mobile-device-item__expire .lifecycle-expiry.expiry--warn {
    font-size: inherit;
    font-weight: 400;
  }
  .mobile-device-item__expire .plan-badge {
    display: none !important;
  }
  .mobile-device-item__expire.expiry--danger { color: var(--danger); }
  .mobile-device-item__expire.expiry--warn { color: var(--warn); }
  .mobile-device-item__expire--free {
    color: var(--text-secondary);
    font-weight: 600;
  }
  .mobile-device-item__expire--free > span {
    font-weight: 600;
  }

  .mobile-device-item__divider,
  .mobile-device-item__foot,
  .mobile-device-item__foot-start,
  .mobile-device-item__battery,
  .mobile-device-item__ports,
  .mobile-device-item__life { display: none !important; }

  .mobile-device-item__extra { display: none; }

  /* Group sheet */
  .fleet-m-group-sheet {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0 12px;
  }
  .fleet-m-group-sheet__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    font-weight: 450;
    text-align: left;
    cursor: pointer;
  }
  .fleet-m-group-sheet__item:active,
  .fleet-m-group-sheet__item.is-active {
    background: var(--blue-soft);
    color: var(--blue);
  }
  .fleet-m-group-sheet__count {
    font-size: 11px;
    font-weight: 450;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }
  .fleet-m-group-sheet__item.is-active .fleet-m-group-sheet__count {
    color: var(--blue);
  }
  .fleet-m-group-sheet__create {
    margin-top: 8px;
    color: var(--blue);
    font-weight: 500;
  }

  /* Global light type scale for any leftover Fleet mobile text */
  .main--fleet,
  .main--fleet button,
  .main--fleet input,
  .main--fleet .command-bar__btn,
  .main--fleet .quick-filter-chip,
  .main--fleet .mobile-device-item {
    -webkit-font-smoothing: antialiased;
  }
  .main--fleet .state-box h3 {
    font-size: 13px !important;
    font-weight: 500 !important;
  }
  .main--fleet .state-box p {
    font-size: 11px !important;
    font-weight: 400 !important;
  }

  /* Device card ⋮ menu — compact type */
  .bottom-sheet--device-actions .bottom-sheet__head h2 {
    font-size: 14px;
    font-weight: 600;
  }
  .bottom-sheet--device-actions .bottom-sheet__sub {
    font-size: 11px;
    font-weight: 450;
  }
  .bottom-sheet--device-actions .action-sheet-item {
    min-height: 40px;
    padding: 0 14px;
    gap: 10px;
    font-size: 13px;
    font-weight: 450;
  }
  .bottom-sheet--device-actions .action-sheet-item .icon {
    width: 16px;
    height: 16px;
  }
  .bottom-sheet--device-actions .action-sheet-list__divider {
    margin: 4px 12px;
  }
}


/* Reserve battery space independently of long device names. */
@media (max-width: 767px) {
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root col[data-col="device"],
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table th.col-device,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table td.col-device {
    width: 180px !important; min-width: 180px !important; max-width: 180px !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root col[data-col="currentIp"],
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table th.col-currentIp,
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table td.col-currentIp {
    width: 172px !important; min-width: 172px !important; max-width: 172px !important;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] #table-root .data-table tbody td.col-device .device-cell__hardware {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] .device-cell__hardware-text {
    display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  [data-layout="mobile"] .fleet[data-mview="list"] .device-cell__battery-inline {
    flex: 0 0 auto; margin-left: 0;
  }
}
