/*
 * SENTINEL mobile experience
 * A standalone touch-first presentation layer. Desktop contracts remain in
 * sentinel-design-system.css and sentinel-desktop-consistency.css.
 */

.mobile-live-tabs,
.mobile-live-focusbar,
.mobile-focus-action,
.mobile-counter-focus-details,
.dashboard-mobile-settings {
  display: none;
}

@media (max-width: 820px) {
  :root {
    --mobile-ui-scale: 1;
    --mobile-font-scale: 1;
    --mobile-space-scale: 1;
    --mobile-viewport-height: 100dvh;
    --mobile-bg: #030b13;
    --mobile-surface: #081522;
    --mobile-surface-raised: #0c1b2a;
    --mobile-line: rgba(129, 164, 191, 0.15);
    --mobile-text: #f3f7fa;
    --mobile-muted: #8ea3b5;
    --mobile-action: #f4b51f;
    --mobile-success: #48d879;
    --mobile-danger: #ff625d;
    --mobile-info: #4dbce9;
    --mobile-radius: calc(16px * var(--mobile-space-scale));
    --mobile-nav-height: calc(68px * var(--mobile-ui-scale));
    --mobile-page-pad: clamp(10px, calc(13px * var(--mobile-space-scale)), 16px);
    --mobile-gap: clamp(7px, calc(10px * var(--mobile-space-scale)), 12px);
    --mobile-touch: clamp(44px, calc(46px * var(--mobile-ui-scale)), 52px);
  }

  html {
    font-size: calc(16px * var(--mobile-font-scale));
    background: var(--mobile-bg);
    overscroll-behavior-y: none;
  }

  body.sentinel-mobile-native {
    min-width: 0;
    background:
      radial-gradient(circle at 85% 2%, rgba(21, 103, 142, 0.16), transparent 34%),
      linear-gradient(180deg, #020912 0%, #050f19 52%, #030a11 100%);
    color: var(--mobile-text);
    -webkit-tap-highlight-color: transparent;
  }

  body.sentinel-mobile-native .orb,
  body.sentinel-mobile-native .grid-noise,
  body.sentinel-mobile-native .sentinel-hud-bg,
  body.sentinel-mobile-native .dashboard-sidebar,
  body.sentinel-mobile-native .mobile-shell-toggle,
  body.sentinel-mobile-native .topbar-primary-nav,
  body.sentinel-mobile-native .status-pill,
  body.sentinel-mobile-native .language-switcher {
    display: none !important;
  }

  body.sentinel-mobile-native .dashboard-app {
    display: block;
    min-height: 100dvh;
    padding: 0;
  }

  body.sentinel-mobile-native .dashboard-main {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0 0 calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + var(--mobile-page-pad));
  }

  body.sentinel-mobile-native .dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    min-height: calc(64px * var(--mobile-ui-scale));
    display: flex;
    align-items: center;
    padding: max(calc(9px * var(--mobile-space-scale)), env(safe-area-inset-top)) var(--mobile-page-pad) calc(8px * var(--mobile-space-scale));
    border: 0;
    border-bottom: 1px solid var(--mobile-line);
    background: rgba(3, 11, 19, 0.92);
    backdrop-filter: blur(16px);
  }

  body.sentinel-mobile-native .brand {
    min-width: 0;
    flex: 1;
  }

  body.sentinel-mobile-native .brand-lockup {
    gap: 9px;
  }

  body.sentinel-mobile-native .topbar-logo {
    width: calc(34px * var(--mobile-ui-scale));
    height: calc(34px * var(--mobile-ui-scale));
    border: 0;
    border-radius: 9px;
    box-shadow: none;
  }

  body.sentinel-mobile-native .brand-kicker {
    font-size: 0.66rem;
    letter-spacing: 0.17em;
    color: var(--mobile-text);
  }

  body.sentinel-mobile-native .brand h1,
  body.sentinel-mobile-native .brand p {
    display: none;
  }

  body.sentinel-mobile-native .mobile-current-view {
    display: block;
    margin-top: 1px;
    color: var(--mobile-muted);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  body.sentinel-mobile-native .status-cluster {
    width: auto;
    flex: 0 0 auto;
    overflow: visible;
    padding: 0;
  }

  body.sentinel-mobile-native .account-control {
    min-width: 0;
    min-height: 38px;
    padding: 4px 7px 4px 4px;
    border-color: var(--mobile-line);
    border-radius: 12px;
    background: rgba(10, 25, 38, 0.82);
  }

  body.sentinel-mobile-native .account-avatar {
    width: 29px;
    height: 29px;
    font-size: 0.68rem;
  }

  body.sentinel-mobile-native .account-copy strong {
    max-width: 72px;
    font-size: 0.7rem;
  }

  body.sentinel-mobile-native .account-copy small {
    display: none;
  }

  body.sentinel-mobile-native .app-section,
  body.sentinel-mobile-native .shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.sentinel-mobile-native .app-section.active {
    padding: calc(14px * var(--mobile-space-scale)) var(--mobile-page-pad) 0;
  }

  body.sentinel-mobile-native .panel,
  body.sentinel-mobile-native .section-panel,
  body.sentinel-mobile-native .metric-card {
    border: 1px solid var(--mobile-line);
    border-radius: var(--mobile-radius);
    background: linear-gradient(145deg, rgba(12, 28, 43, 0.96), rgba(6, 18, 29, 0.98));
    box-shadow: none;
  }

  body.sentinel-mobile-native .panel::before,
  body.sentinel-mobile-native .panel::after,
  body.sentinel-mobile-native .section-panel::before,
  body.sentinel-mobile-native .section-panel::after {
    display: none;
  }

  body.sentinel-mobile-native .panel-head {
    align-items: flex-start;
    margin: 0 0 12px;
    padding: 0;
  }

  body.sentinel-mobile-native .panel-head h2,
  body.sentinel-mobile-native .war-counter-heading h2,
  body.sentinel-mobile-native .scanroom-head h2 {
    font-size: 1.32rem;
    letter-spacing: -0.025em;
  }

  body.sentinel-mobile-native .tutorial-page-help {
    width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 50%;
  }

  /* Dashboard is an app launcher, not a compressed desktop landing page. */
  body.sentinel-mobile-native [data-section-panel="dashboard"] > .section-panel:first-child {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.sentinel-mobile-native [data-section-panel="dashboard"] .panel-head p {
    display: block;
    max-width: 25rem;
    margin-top: 4px;
    color: var(--mobile-muted);
    font-size: 0.78rem;
  }

  body.sentinel-mobile-native .dashboard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--mobile-gap);
    margin-top: calc(13px * var(--mobile-space-scale));
  }

  body.sentinel-mobile-native .dashboard-action-card {
    position: relative;
    min-height: calc(114px * var(--mobile-ui-scale));
    justify-content: flex-end;
    padding: calc(13px * var(--mobile-space-scale));
    border: 1px solid var(--mobile-line);
    border-radius: var(--mobile-radius);
    background:
      radial-gradient(circle at 78% 15%, rgba(77, 188, 233, 0.16), transparent 34%),
      var(--mobile-surface);
    text-align: left;
  }

  body.sentinel-mobile-native .dashboard-mobile-settings {
    display: flex;
  }

  body.sentinel-mobile-native .dashboard-action-card::before {
    content: attr(data-mobile-icon);
    position: absolute;
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(244, 181, 31, 0.12);
    color: var(--mobile-action);
    font-size: 0.72rem;
    font-weight: 900;
  }

  body.sentinel-mobile-native .dashboard-action-card:nth-child(1)::before { content: "WC"; }
  body.sentinel-mobile-native .dashboard-action-card:nth-child(3)::before { content: "LIVE"; }
  body.sentinel-mobile-native .dashboard-mobile-settings::before { content: "SET"; }
  body.sentinel-mobile-native .dashboard-action-card strong {
    display: none;
  }
  body.sentinel-mobile-native .dashboard-action-card::after {
    content: attr(data-mobile-title);
    font-size: 0.85rem;
    font-weight: 850;
    line-height: 1.22;
  }
  body.sentinel-mobile-native .dashboard-action-card span {
    display: none;
  }

  body.sentinel-mobile-native .dashboard-support-panel,
  body.sentinel-mobile-native .dashboard-status-panel {
    display: none !important;
  }

  /* War Counter: three clear steps, then touch-native result cards. */
  body.sentinel-mobile-native .war-counter-workspace.active {
    padding: calc(13px * var(--mobile-space-scale)) var(--mobile-page-pad) 0;
  }

  body.sentinel-mobile-native .war-counter-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    margin: 0 2px 12px;
  }

  body.sentinel-mobile-native .war-counter-heading > div {
    grid-column: 1;
  }

  body.sentinel-mobile-native .war-counter-heading > p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--mobile-muted);
    font-size: 0.75rem;
  }

  body.sentinel-mobile-native .war-counter-heading .tutorial-page-help {
    grid-column: 2;
    grid-row: 1;
  }

  body.sentinel-mobile-native .war-counter-kicker {
    display: none;
  }

  body.sentinel-mobile-native .war-counter-toolbar {
    padding: 12px;
  }

  body.sentinel-mobile-native .war-counter-toolbar-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.sentinel-mobile-native .war-counter-defense-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  body.sentinel-mobile-native .war-counter-control-label,
  body.sentinel-mobile-native .war-counter-composer-preview {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.sentinel-mobile-native .war-counter-control-label::before {
    content: "1";
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 7px;
    border-radius: 7px;
    background: var(--mobile-action);
    color: #111820;
  }

  body.sentinel-mobile-native #warCounterComposeBtn {
    min-height: var(--mobile-touch);
    justify-content: center;
    background: linear-gradient(135deg, #ffc62e, #e59b09);
    color: #10161d;
  }

  body.sentinel-mobile-native .war-counter-composer-preview {
    min-height: 64px;
    padding: 9px;
    border-radius: 13px;
    background: rgba(2, 10, 17, 0.72);
  }

  body.sentinel-mobile-native .war-counter-legacy,
  body.sentinel-mobile-native .war-counter-buff-control,
  body.sentinel-mobile-native .war-counter-count-control,
  body.sentinel-mobile-native #reloadBtn {
    display: none !important;
  }

  body.sentinel-mobile-native .war-counter-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body.sentinel-mobile-native #submitBtn {
    min-height: max(48px, var(--mobile-touch));
    font-size: 0.88rem;
  }

  body.sentinel-mobile-native #clearBtn {
    width: 50px;
    min-width: 50px;
    overflow: hidden;
    color: transparent;
  }

  body.sentinel-mobile-native #clearBtn::after {
    content: "×";
    color: var(--mobile-muted);
    font-size: 1.3rem;
  }

  body.sentinel-mobile-native .war-counter-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(54px, 0.7fr));
    gap: 1px;
    margin: 10px 0;
    padding: 0;
    border: 1px solid var(--mobile-line);
    border-radius: 13px;
    overflow: hidden;
    background: var(--mobile-line);
  }

  body.sentinel-mobile-native .war-counter-summary > div {
    min-width: 0;
    padding: 8px;
    background: #07131e;
  }

  body.sentinel-mobile-native .war-counter-summary span {
    font-size: 0.56rem;
  }

  body.sentinel-mobile-native .war-counter-summary strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.sentinel-mobile-native .war-counter-copy {
    display: none;
  }

  body.sentinel-mobile-native .war-counter-results-head {
    margin: 14px 2px 8px;
  }

  body.sentinel-mobile-native .war-counter-results-head h2 {
    font-size: 0.95rem;
  }

  body.sentinel-mobile-native .war-counter-results-head p {
    font-size: 0.68rem;
  }

  body.sentinel-mobile-native .war-counter-table-wrap,
  body.sentinel-mobile-native .war-counter-table,
  body.sentinel-mobile-native .war-counter-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body.sentinel-mobile-native .war-counter-table thead {
    display: none;
  }

  body.sentinel-mobile-native .war-counter-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px 66px;
    gap: calc(8px * var(--mobile-space-scale));
    margin-bottom: 9px;
    padding: calc(11px * var(--mobile-space-scale)) calc(11px * var(--mobile-space-scale)) calc(10px * var(--mobile-space-scale)) calc(42px * var(--mobile-space-scale));
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: var(--mobile-surface);
  }

  body.sentinel-mobile-native .war-counter-best-row {
    border-color: rgba(72, 216, 121, 0.52);
    background: linear-gradient(145deg, rgba(12, 43, 38, 0.9), var(--mobile-surface));
  }

  body.sentinel-mobile-native .war-counter-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  body.sentinel-mobile-native .war-counter-rank {
    position: absolute;
    top: 12px;
    left: 10px;
    width: 25px;
    height: 25px;
    display: grid !important;
    place-items: center;
    border-radius: 8px;
    background: rgba(244, 181, 31, 0.14);
    color: var(--mobile-action);
  }

  body.sentinel-mobile-native .war-counter-team-cell {
    gap: 6px;
  }

  body.sentinel-mobile-native .war-counter-team-cell strong {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  body.sentinel-mobile-native .war-counter-team-cell .inline-character-row {
    flex-wrap: nowrap;
    gap: 2px;
    overflow: hidden;
  }

  body.sentinel-mobile-native .war-counter-team-cell .character-chip {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  body.sentinel-mobile-native .war-counter-score,
  body.sentinel-mobile-native .war-counter-winrate {
    display: grid !important;
    align-content: center;
    min-height: 48px;
    padding: 6px !important;
    border-radius: 10px !important;
    background: rgba(2, 10, 17, 0.7);
    text-align: center;
  }

  body.sentinel-mobile-native .war-counter-score::before,
  body.sentinel-mobile-native .war-counter-winrate::before {
    display: block;
    color: var(--mobile-muted);
    font-size: 0.52rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  body.sentinel-mobile-native .war-counter-score::before { content: "Score"; }
  body.sentinel-mobile-native .war-counter-winrate::before { content: "Win rate"; }

  body.sentinel-mobile-native .war-counter-score strong,
  body.sentinel-mobile-native .war-counter-winrate strong {
    color: var(--mobile-success);
    font-size: 0.96rem;
  }

  body.sentinel-mobile-native .war-counter-score span {
    display: none;
  }

  body.sentinel-mobile-native .war-counter-row > td:nth-child(5) {
    grid-column: 1 / -1;
  }

  body.sentinel-mobile-native .war-counter-quality {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 8px;
    border-top: 1px solid var(--mobile-line);
  }

  body.sentinel-mobile-native .war-counter-quality-stats,
  body.sentinel-mobile-native .war-counter-quality em {
    margin-left: auto;
    font-size: 0.61rem;
  }

  body.sentinel-mobile-native .war-counter-note,
  body.sentinel-mobile-native .war-counter-expand {
    display: none !important;
  }

  body.sentinel-mobile-native .war-counter-detail-row {
    display: block;
    margin: -5px 0 10px;
  }

  body.sentinel-mobile-native .war-counter-detail-row.hidden {
    display: none;
  }

  body.sentinel-mobile-native .war-counter-detail-row td {
    display: block;
    padding: 10px;
    border: 1px solid var(--mobile-line);
    border-radius: 14px;
    background: #07131e;
  }

  body.sentinel-mobile-native .war-counter-detail-grid,
  body.sentinel-mobile-native .war-counter-detail-intelligence {
    grid-template-columns: 1fr;
  }

  /* Composer is a full-screen mobile workspace. */
  body.sentinel-mobile-native .scan-composer {
    inset: 0 !important;
    z-index: 1900;
    width: 100%;
    max-width: none;
    height: var(--mobile-viewport-height);
    max-height: var(--mobile-viewport-height);
    padding: max(var(--mobile-page-pad), env(safe-area-inset-top)) var(--mobile-page-pad) calc(var(--mobile-page-pad) + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: var(--mobile-bg);
    box-shadow: none;
  }

  body.sentinel-mobile-native .scan-composer.scan-composer-inline {
    position: relative !important;
    inset: auto !important;
    z-index: 4;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 12px;
    border: 1px solid var(--mobile-line);
    border-radius: 14px;
    background: #07131e;
    overflow: visible;
  }

  body.sentinel-mobile-native .war-live-defense-builder {
    padding: 10px;
    gap: 8px;
  }

  body.sentinel-mobile-native .war-live-defense-builder-head {
    align-items: flex-start;
  }

  body.sentinel-mobile-native .war-live-defense-builder-head > div span {
    display: none;
  }

  body.sentinel-mobile-native .war-live-defense-draft {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  body.sentinel-mobile-native .war-live-draft-order {
    width: 24px;
    height: 24px;
  }

  body.sentinel-mobile-native .war-live-draft-portraits {
    grid-column: 2;
    overflow-x: auto;
  }

  body.sentinel-mobile-native .war-live-draft-copy {
    grid-column: 2;
  }

  body.sentinel-mobile-native .war-live-draft-status {
    grid-column: 3;
    grid-row: 1;
  }

  body.sentinel-mobile-native .war-live-draft-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-content: flex-end;
  }

  body.sentinel-mobile-native .war-live-draft-actions .btn {
    min-height: 36px;
  }

  body.sentinel-mobile-native.scan-modal-open .mobile-bottom-nav {
    display: none;
  }

  body.sentinel-mobile-native .scan-composer-slots {
    grid-auto-flow: row;
    grid-template-columns: 1fr !important;
    overflow: visible;
  }

  body.sentinel-mobile-native .scan-composer-member-grid {
    grid-auto-columns: minmax(150px, 72vw);
  }

  body.sentinel-mobile-native .scan-composer-slot {
    min-height: 0;
  }

  body.sentinel-mobile-native .scan-composer-actions {
    bottom: calc(-14px + env(safe-area-inset-bottom));
  }

  /* War Live has three mobile views and a distraction-free counter focus. */
  body.sentinel-mobile-native .scanroom-shell.active {
    padding: 12px 11px 0;
  }

  body.sentinel-mobile-native .scanroom-shell {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body.sentinel-mobile-native .war-live-board {
    width: 100%;
    min-width: 0;
  }

  body.sentinel-mobile-native .scanroom-head {
    margin-bottom: 10px;
  }

  body.sentinel-mobile-native .scanroom-head p,
  body.sentinel-mobile-native .scanroom-meta {
    display: none;
  }

  body.sentinel-mobile-native .war-live-setup-panel {
    padding: 12px;
  }

  body.sentinel-mobile-native .scanroom-shell.war-live-session-active .war-live-setup-panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.sentinel-mobile-native .scanroom-shell.war-live-session-active .war-live-setup-panel > .scanroom-active-rooms,
  body.sentinel-mobile-native .scanroom-shell.war-live-session-active .war-live-setup-panel > .scanroom-form {
    display: none;
  }

  body.sentinel-mobile-native .war-live-setup-form {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.sentinel-mobile-native .war-live-setup-form > .field:last-of-type,
  body.sentinel-mobile-native .war-live-setup-actions {
    grid-column: 1 / -1;
  }

  body.sentinel-mobile-native .mobile-live-tabs {
    position: sticky;
    top: 66px;
    z-index: 48;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    margin: 0 0 10px;
    padding: 4px;
    border: 1px solid var(--mobile-line);
    border-radius: 13px;
    background: rgba(5, 15, 24, 0.94);
  }

  body.sentinel-mobile-native .mobile-live-tabs button {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--mobile-muted);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
  }

  body.sentinel-mobile-native .mobile-live-tabs button.active {
    background: rgba(244, 181, 31, 0.13);
    color: var(--mobile-action);
  }

  body.sentinel-mobile-native .war-live-commandbar {
    display: none;
  }

  body.sentinel-mobile-native .scan-mobile-quick {
    display: none !important;
  }

  body.sentinel-mobile-native .war-live-grid {
    display: block;
  }

  body.sentinel-mobile-native .war-live-grid > * {
    display: none;
  }

  body.sentinel-mobile-native .war-live-board[data-mobile-view="overview"] .war-live-queue,
  body.sentinel-mobile-native .war-live-board[data-mobile-view="target"] .war-live-target,
  body.sentinel-mobile-native .war-live-board[data-mobile-view="counter"] .war-live-counters {
    display: block;
  }

  body.sentinel-mobile-native .mobile-panel-details {
    display: block;
    margin: 0;
    border: 0;
    background: transparent;
  }

  body.sentinel-mobile-native .mobile-panel-details > summary {
    display: none !important;
  }

  body.sentinel-mobile-native .mobile-panel-details-content {
    padding: 0;
  }

  body.sentinel-mobile-native .war-live-queue-list {
    gap: 8px;
  }

  body.sentinel-mobile-native .war-live-queue-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 66px;
    padding: 9px;
    border-radius: 13px;
  }

  body.sentinel-mobile-native .war-live-queue-item.current {
    border-color: var(--mobile-action);
    background: linear-gradient(90deg, rgba(244, 181, 31, 0.13), var(--mobile-surface));
  }

  body.sentinel-mobile-native .war-live-target {
    min-height: 0;
  }

  body.sentinel-mobile-native .scan-current {
    padding: 13px;
  }

  body.sentinel-mobile-native .war-live-context-pills {
    gap: 5px;
  }

  body.sentinel-mobile-native .war-live-context-pill {
    padding: 5px 7px;
    font-size: 0.62rem;
  }

  body.sentinel-mobile-native .war-live-top-counters {
    gap: 9px;
  }

  body.sentinel-mobile-native .war-live-counter-card {
    position: relative;
    min-height: calc(108px * var(--mobile-ui-scale));
    padding: calc(11px * var(--mobile-space-scale)) calc(11px * var(--mobile-space-scale)) calc(29px * var(--mobile-space-scale));
    border-radius: 15px;
  }

  body.sentinel-mobile-native .war-live-counter-card.primary-choice {
    border-color: rgba(72, 216, 121, 0.6);
    background: linear-gradient(145deg, rgba(13, 50, 42, 0.94), var(--mobile-surface));
  }

  body.sentinel-mobile-native .war-live-counter-card:not(.primary-choice) {
    opacity: 0.88;
  }

  body.sentinel-mobile-native .mobile-focus-action {
    position: absolute;
    right: 10px;
    bottom: 8px;
    display: block;
    color: var(--mobile-info);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  body.sentinel-mobile-native.mobile-counter-focus {
    overflow: hidden;
  }

  body.sentinel-mobile-native.mobile-counter-focus .dashboard-topbar,
  body.sentinel-mobile-native.mobile-counter-focus .mobile-bottom-nav,
  body.sentinel-mobile-native.mobile-counter-focus .scanroom-head,
  body.sentinel-mobile-native.mobile-counter-focus .mobile-live-tabs {
    display: none !important;
  }

  body.sentinel-mobile-native .mobile-live-focusbar {
    display: none;
  }

  body.sentinel-mobile-native.mobile-counter-focus .mobile-live-focusbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 80;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    border-bottom: 1px solid var(--mobile-line);
    background: rgba(3, 11, 19, 0.96);
  }

  body.sentinel-mobile-native .mobile-live-focusbar button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--mobile-line);
    border-radius: 11px;
    background: var(--mobile-surface);
    color: var(--mobile-text);
  }

  body.sentinel-mobile-native .mobile-live-focusbar div {
    display: grid;
  }

  body.sentinel-mobile-native .mobile-live-focusbar span {
    color: var(--mobile-muted);
    font-size: 0.58rem;
    text-transform: uppercase;
  }

  body.sentinel-mobile-native .mobile-live-focusbar strong {
    font-size: 0.83rem;
  }

  body.sentinel-mobile-native .mobile-live-focus-status {
    color: var(--mobile-success) !important;
  }

  body.sentinel-mobile-native.mobile-counter-focus [data-section-panel="scan-room"].active,
  body.sentinel-mobile-native.mobile-counter-focus .scanroom-shell,
  body.sentinel-mobile-native.mobile-counter-focus .war-live-board {
    width: 100%;
    height: 100dvh;
    padding: 0;
  }

  body.sentinel-mobile-native.mobile-counter-focus .war-live-grid {
    height: calc(100dvh - 58px - env(safe-area-inset-top));
    overflow-y: auto;
    padding: calc(69px + env(safe-area-inset-top)) 11px calc(16px + env(safe-area-inset-bottom));
  }

  body.sentinel-mobile-native.mobile-counter-focus .war-live-counter-card {
    min-height: 145px;
  }

  body.sentinel-mobile-native.mobile-counter-focus .war-live-counter-card:not(.selected) {
    display: none;
  }

  body.sentinel-mobile-native.mobile-counter-focus .war-live-more-counters,
  body.sentinel-mobile-native.mobile-counter-focus .scan-discouraged-counters,
  body.sentinel-mobile-native.mobile-counter-focus .mobile-focus-action {
    display: none;
  }

  body.sentinel-mobile-native.mobile-counter-focus .war-live-counter-card.selected .mobile-counter-focus-details {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--mobile-line);
    text-align: left;
  }

  body.sentinel-mobile-native .mobile-counter-focus-details > span {
    display: grid;
    gap: 2px;
    color: var(--mobile-muted);
    font-size: 0.7rem;
    line-height: 1.35;
  }

  body.sentinel-mobile-native .mobile-counter-focus-details b {
    color: var(--mobile-text);
    font-size: 0.65rem;
    text-transform: uppercase;
  }

  /* Settings is a native preference list for Guest/User. */
  body.sentinel-mobile-native [data-section-panel="settings"].active {
    padding: 15px 12px 0;
  }

  body.sentinel-mobile-native [data-section-panel="settings"] > .section-panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.sentinel-mobile-native .settings-layout {
    display: block;
  }

  body.sentinel-mobile-native .settings-nav {
    display: flex;
    gap: 7px;
    margin: 0 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.sentinel-mobile-native .settings-nav::-webkit-scrollbar {
    display: none;
  }

  body.sentinel-mobile-native .settings-nav-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 11px;
    border-radius: 11px;
    font-size: 0.7rem;
  }

  body.sentinel-mobile-native .settings-content,
  body.sentinel-mobile-native .settings-subsection.active {
    display: grid;
    gap: 9px;
  }

  body.sentinel-mobile-native .settings-subsection .metric-card {
    padding: calc(11px * var(--mobile-space-scale));
  }

  body.sentinel-mobile-native .settings-subsection .metric-card > strong {
    font-size: 0.86rem;
  }

  body.sentinel-mobile-native .settings-subsection .metric-card > p {
    font-size: 0.7rem;
  }

  body.sentinel-mobile-native .btn,
  body.sentinel-mobile-native button,
  body.sentinel-mobile-native input,
  body.sentinel-mobile-native select,
  body.sentinel-mobile-native textarea {
    touch-action: manipulation;
  }

  body.sentinel-mobile-native .btn {
    min-height: var(--mobile-touch);
    border-radius: 12px;
  }

  body.sentinel-mobile-native input,
  body.sentinel-mobile-native select,
  body.sentinel-mobile-native textarea {
    min-height: var(--mobile-touch);
    font-size: 16px !important;
  }

  body.sentinel-mobile-native .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    padding: calc(6px * var(--mobile-space-scale)) var(--mobile-page-pad) env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid var(--mobile-line);
    border-radius: 0;
    background: rgba(3, 11, 19, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.24);
  }

  body.sentinel-mobile-native .mobile-nav-btn {
    flex: 1;
    min-width: 0;
    min-height: calc(52px * var(--mobile-ui-scale));
    gap: 3px;
    padding: 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--mobile-muted);
  }

  body.sentinel-mobile-native .mobile-nav-btn.active {
    background: transparent;
    color: var(--mobile-action);
    box-shadow: none;
  }

  body.sentinel-mobile-native .mobile-nav-icon {
    width: auto;
    height: 23px;
    border: 0;
    background: transparent;
    font-size: 0.64rem;
  }

  body.sentinel-mobile-native .mobile-nav-label {
    font-size: 0.62rem;
  }

  body.sentinel-mobile-native .auth-dialog-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  body.sentinel-mobile-native .auth-dialog-card {
    width: 100%;
    max-height: 92dvh;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  body.sentinel-mobile-native .toast {
    right: 12px;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 10px);
    left: 12px;
    width: auto;
  }
}

/* Runtime viewport profiles complement the fluid scale for edge-case devices. */
@media (max-width: 820px) {
  body.sentinel-mobile-native[data-mobile-size="compact"] .dashboard-action-card {
    min-height: calc(96px * var(--mobile-ui-scale));
  }

  body.sentinel-mobile-native[data-mobile-size="compact"] .dashboard-action-card::before {
    width: 28px;
    height: 28px;
  }

  body.sentinel-mobile-native[data-mobile-size="compact"] .war-counter-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.sentinel-mobile-native[data-mobile-size="compact"] .war-counter-summary > div {
    min-height: 46px;
  }

  body.sentinel-mobile-native[data-mobile-size="compact"] .war-counter-row {
    grid-template-columns: minmax(0, 1fr) 58px 58px;
  }

  body.sentinel-mobile-native[data-mobile-size="expanded"] .dashboard-main > .app-section {
    max-width: 680px;
    margin-inline: auto;
  }

  body.sentinel-mobile-native[data-mobile-size="expanded"] .dashboard-action-card {
    min-height: calc(126px * var(--mobile-ui-scale));
  }

  body.sentinel-mobile-native[data-mobile-size="expanded"] .war-counter-team-cell .character-chip {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  body.sentinel-mobile-native[data-mobile-size="expanded"] .war-counter-score strong,
  body.sentinel-mobile-native[data-mobile-size="expanded"] .war-counter-winrate strong {
    font-size: 1.08rem;
  }

  body.sentinel-mobile-native[data-mobile-height="short"] .dashboard-topbar {
    min-height: 54px;
  }

  body.sentinel-mobile-native[data-mobile-height="short"] .topbar-logo {
    width: 30px;
    height: 30px;
  }

  body.sentinel-mobile-native[data-mobile-height="short"] .dashboard-action-card {
    min-height: 86px;
  }

  body.sentinel-mobile-native[data-mobile-height="short"] .mobile-bottom-nav {
    --mobile-nav-height: 60px;
  }

  body.sentinel-mobile-native[data-mobile-height="short"] .scan-composer-slot {
    padding-block: 0.48rem;
  }

  body.sentinel-mobile-native[data-mobile-height="tall"] .dashboard-action-card {
    min-height: calc(124px * var(--mobile-ui-scale));
  }

  body.sentinel-mobile-native[data-mobile-orientation="landscape"] .dashboard-topbar {
    position: relative;
    min-height: 52px;
  }

  body.sentinel-mobile-native[data-mobile-orientation="landscape"] .dashboard-main {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  body.sentinel-mobile-native[data-mobile-orientation="landscape"] .mobile-bottom-nav {
    --mobile-nav-height: 58px;
  }

  body.sentinel-mobile-native[data-mobile-orientation="landscape"] .scan-composer-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--mobile-gap);
  }

  body.sentinel-mobile-native[data-mobile-orientation="landscape"] .scan-composer-slot {
    padding: 0.5rem;
  }

  body.sentinel-mobile-native[data-mobile-orientation="landscape"] .scan-composer-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 370px) {
  body.sentinel-mobile-native .account-copy {
    display: none;
  }

  body.sentinel-mobile-native .dashboard-action-card {
    min-height: 104px;
    padding: 11px;
  }

  body.sentinel-mobile-native .war-counter-row {
    grid-template-columns: minmax(0, 1fr) 58px 58px;
    padding-left: 39px;
  }
}
