.ib-account-mobile-intro,
.ib-account-mobile-controls,
.ib-account-mobile-cards,
.ib-account-mobile-count,
.ib-account-mobile-sort {
  display: none;
}

.ib-account-mobile-filter-sheet:not([open]),
.ib-account-mobile-detail-modal:not([open]) {
  display: none;
}

.ib-account-mobile-detail-modal {
  inset: 0;
  width: min(560px, calc(100% - 48px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  color: var(--text);
}

.ib-account-mobile-detail-modal .ib-account-overview-dialog {
  width: 100%;
  max-height: calc(100dvh - 48px);
}

.ib-account-mobile-detail-modal:has(.ib-account-overview-guide-dialog) {
  width: min(760px, calc(100% - 48px));
}

.ib-account-mobile-filter-sheet::backdrop,
.ib-account-mobile-detail-modal::backdrop {
  background: rgba(12, 20, 36, 0.46);
  backdrop-filter: blur(3px);
}

@media (max-width: 760px) {
  body.ib-account-mobile-ready .ib-report-page {
    padding: 20px 16px calc(36px + env(safe-area-inset-bottom, 0px));
  }

  body.ib-account-mobile-ready .ib-account-overview-heading {
    margin-bottom: 18px;
  }

  body.ib-account-mobile-ready .ib-account-overview-heading h1 {
    font-size: 21px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: -0.5px;
  }

  body.ib-account-mobile-ready .ib-account-overview-heading p:not(.ib-account-mobile-intro) { display: none; }
  body.ib-account-mobile-ready .ib-account-mobile-intro { display: block; margin-top: 6px; font-size: 12px; line-height: 1.7; }
  .ib-account-mobile-controls { display: block; margin-bottom: 20px; }
  .ib-account-mobile-search { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px; padding: 0 6px 0 14px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--surface-raised); box-shadow: 0 3px 12px rgba(15, 23, 42, 0.025); }
  .ib-account-mobile-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
  .ib-account-mobile-search label { display: flex; align-items: center; flex: 1; min-width: 0; gap: 9px; color: var(--muted); }
  .ib-account-mobile-search input { width: 100%; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
  .ib-account-mobile-search input::placeholder { color: var(--muted); font-size: 13px; }
  .ib-account-mobile-search button { min-height: 44px; border: 0; border-radius: 8px; padding: 0 12px; background: transparent; color: var(--blue); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
  .ib-account-mobile-pills { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
  .ib-account-mobile-pills button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-light); border-radius: 999px; background: var(--surface-raised); color: var(--text-soft); font: inherit; font-size: 12px; font-weight: 550; white-space: nowrap; cursor: pointer; }
  .ib-account-mobile-pills button[aria-pressed="true"] { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, var(--border-light)); background: var(--blue-soft); }
  .ib-account-mobile-pills button > .bi-chevron-down { color: var(--muted); font-size: 10px; }
  .ib-account-mobile-pills .ib-account-mobile-filter-trigger { margin-left: auto; }
  .ib-account-mobile-filter-trigger b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; }
  .ib-account-mobile-filter-trigger b[hidden] { display: none; }
  .ib-account-mobile-active { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .ib-account-mobile-active[hidden] { display: none; }
  .ib-account-mobile-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; min-height: 36px; padding: 5px 9px 5px 12px; border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--border-light)); border-radius: 999px; background: var(--blue-soft); color: var(--blue); font: inherit; font-size: 11px; cursor: pointer; }
  .ib-account-mobile-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ib-account-mobile-chip i { font-size: 16px; flex-shrink: 0; }

  body.ib-account-mobile-ready .ib-account-overview-table-card { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar { display: flex; flex-wrap: wrap; flex-direction: row; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 8px; padding: 0; border: 0; scroll-margin-top: 84px; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-group { gap: 8px; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-group:first-child { flex: 1; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-title strong { font-size: 15px; }
  body.ib-account-mobile-ready .ib-account-overview-guide-trigger { width: 36px; height: 44px; border: 0; background: transparent; font-size: 14px; }
  body.ib-account-mobile-ready .ib-account-mobile-count { display: inline; color: var(--muted); font-size: 11px; white-space: nowrap; }
  body.ib-account-mobile-ready :is(.ib-account-overview-direct-toggle, [data-preferences]) { display: none; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-group:nth-child(2) { gap: 2px; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-group:nth-child(2) .ib-account-overview-button { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 0; }
  body.ib-account-mobile-ready .ib-account-overview-toolbar-group:nth-child(2) .ib-account-overview-button i { font-size: 17px; }
  .ib-account-mobile-sort { display: flex; align-items: center; gap: 7px; position: relative; flex-basis: 100%; margin: -2px 0 4px; color: var(--muted); font-size: 11px; }
  .ib-account-mobile-sort select { appearance: none; min-width: 0; max-width: calc(100% - 44px); min-height: 44px; padding: 8px 28px 8px 10px; border: 0; border-radius: 8px; background: var(--surface-muted); color: var(--text-soft); font: inherit; font-size: 12px; cursor: pointer; }
  .ib-account-mobile-sort i { margin-left: -27px; pointer-events: none; font-size: 10px; }
  body.ib-account-mobile-ready .ib-account-overview-table-wrap { display: none; }
  .ib-account-mobile-cards { display: grid; gap: 12px; }
  .ib-account-mobile-card { min-width: 0; padding: 14px; border: 1px solid var(--border-light); border-radius: 14px; background: var(--surface-raised); box-shadow: 0 4px 18px rgba(15, 23, 42, 0.025); }
  .ib-account-mobile-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .ib-account-mobile-card-client { display: grid; gap: 5px; min-width: 0; }
  .ib-account-mobile-card-client > strong { color: var(--text-strong); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
  .ib-account-mobile-card-client > span { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
  .ib-account-mobile-detail { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; min-height: 44px; padding: 0 0 0 10px; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
  .ib-account-mobile-detail i { font-size: 10px; }
  .ib-account-mobile-card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; margin: 10px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); color: var(--muted); font-size: 10px; line-height: 1.5; }
  .ib-account-mobile-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin: 14px 0 0; }
  .ib-account-mobile-metrics > div { min-width: 0; display: grid; gap: 5px; }
  .ib-account-mobile-metrics dt { color: var(--muted); font-size: 11px; }
  .ib-account-mobile-metrics dd { margin: 0; color: var(--text-strong); font-size: 14px; font-weight: 650; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .ib-account-mobile-card.is-skeleton { min-height: 222px; }
  .ib-account-mobile-card.is-skeleton .ib-account-mobile-metrics { margin-top: 30px; }
  body.ib-account-mobile-ready .ib-account-overview-empty { border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-raised); }
  body.ib-account-mobile-ready .ib-account-overview-footer { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px 0 0; }
  body.ib-account-mobile-ready .ib-account-overview-footer-summary { justify-content: space-between; gap: 6px; font-size: 11px; }
  body.ib-account-mobile-ready .ib-account-overview-footer-summary label { height: 44px; border-radius: 9px; }
  body.ib-account-mobile-ready .ib-account-overview-footer-summary select { height: 42px; }
  body.ib-account-mobile-ready .ib-account-overview-pager { justify-content: center; gap: 8px; }
  body.ib-account-mobile-ready .ib-account-overview-pager button { min-width: 44px; height: 44px; border-radius: 10px; }

  body:is(.ib-account-filter-open, .ib-account-detail-open, .ib-account-guide-open) { overflow: hidden; }
  .ib-account-mobile-filter-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: none; height: min(820px, 90dvh); max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px))); margin: 0; padding: 0; border: 1px solid var(--border-light); border-bottom: 0; border-radius: 22px 22px 0 0; background: var(--surface-raised); color: var(--text); overflow: hidden; box-shadow: var(--shadow-floating); }
  .ib-account-mobile-filter-sheet[open] { display: flex; flex-direction: column; }
  .ib-account-mobile-sheet-handle { flex: 0 0 20px; display: grid; place-items: center; }
  .ib-account-mobile-sheet-handle::before { content: ""; width: 34px; height: 4px; border-radius: 999px; background: var(--border); }
  .ib-account-mobile-filter-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 0 18px 14px; border-bottom: 1px solid var(--border-light); }
  .ib-account-mobile-filter-sheet h2 { margin: 0; color: var(--text-strong); font-size: 18px; line-height: 1.5; }
  .ib-account-mobile-filter-sheet header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
  .ib-account-mobile-filter-sheet header button { flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-muted); color: var(--text-soft); font-size: 16px; cursor: pointer; }
  .ib-account-mobile-filter-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.ib-account-mobile-ready .ib-account-mobile-filter-body .ib-account-overview-filter { margin: 0; padding: 20px 18px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  body.ib-account-mobile-ready .ib-account-overview-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  body.ib-account-mobile-ready .ib-account-overview-field { gap: 8px; }
  body.ib-account-mobile-ready .ib-account-overview-field:has([data-filter="keyword"]),
  body.ib-account-mobile-ready .ib-account-overview-field:last-child { grid-column: 1 / -1; }
  body.ib-account-mobile-ready .ib-account-overview-field > span:first-child { font-size: 12px; font-weight: 600; }
  body.ib-account-mobile-ready .ib-account-overview-field :is(input, select),
  body.ib-account-mobile-ready .ib-account-overview-date-range { height: 48px; border-radius: 10px; font-size: 16px; }
  body.ib-account-mobile-ready .ib-account-overview-field input::placeholder { font-size: 13px; }
  body.ib-account-mobile-ready .ib-account-overview-date-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; padding-right: 0; }
  body.ib-account-mobile-ready .ib-account-overview-date-range > i { display: none; }
  body.ib-account-mobile-ready .ib-account-overview-date-range input { width: 100%; padding: 0 6px; border: 0; font-size: 13px; }
  body.ib-account-mobile-ready .ib-account-overview-filter-actions { margin-top: 20px; }
  .ib-account-mobile-filter-body .ib-account-overview-actions { display: none; }
  .ib-account-mobile-filter-sheet > footer { display: flex; gap: 12px; flex-shrink: 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-light); background: var(--surface-raised); }
  body.ib-account-mobile-ready .ib-account-mobile-filter-sheet > footer button { height: 48px; border-radius: 12px; font-size: 14px; }
  .ib-account-mobile-filter-sheet > footer button:first-child { flex: 0 0 90px; }
  .ib-account-mobile-filter-sheet > footer button:last-child { flex: 1; }
  :root[data-theme="dark"] .ib-account-mobile-filter-sheet > footer .primary,
  :root[data-theme="dark"] .ib-account-mobile-detail-modal .ib-account-overview-dialog-foot .primary { background: var(--blue); border-color: var(--blue); color: var(--neutral-ink, #07111f); }
  :root[data-theme="dark"] .ib-account-mobile-pills button[aria-pressed="true"] { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 25%, var(--border)); color: var(--blue); }
  :root[data-theme="dark"] .ib-account-mobile-filter-sheet input[type="date"] { color-scheme: dark; }

  .ib-account-mobile-detail-modal,
  .ib-account-mobile-detail-modal:has(.ib-account-overview-guide-dialog) { inset: auto 0 0; width: 100%; max-width: none; max-height: 90dvh; margin: 0; border-radius: 22px 22px 0 0; }
  .ib-account-mobile-detail-modal .ib-account-overview-dialog { max-height: 90dvh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .ib-account-mobile-detail-modal .ib-account-overview-dialog-head { padding: 14px 16px; }
  body.ib-account-mobile-ready .ib-account-mobile-detail-modal .ib-account-overview-dialog-head button { width: 44px; height: 44px; }
  .ib-account-mobile-detail-modal .ib-account-overview-dialog-body { padding: 16px; }
  .ib-account-mobile-detail-modal .ib-account-overview-dialog-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.ib-account-mobile-ready .ib-account-mobile-detail-modal .ib-account-overview-dialog-foot button { min-height: 44px; height: 44px; }
  .ib-account-mobile-detail-identity { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
  .ib-account-mobile-detail-modal .ib-account-overview-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ib-account-mobile-detail-modal .ib-account-overview-detail-summary > div { min-width: 0; padding: 12px 10px; }
  .ib-account-mobile-detail-modal .ib-account-overview-detail-summary .ib-account-mobile-detail-value { padding: 0; border: 0; background: transparent; color: var(--text-strong); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
  .ib-account-mobile-detail-modal .ib-account-overview-detail-summary strong { font-size: 13px; overflow-wrap: anywhere; }
  .ib-account-mobile-detail-modal .ib-account-overview-detail-summary > div:has(.ib-account-overview-stack) { grid-column: 1 / -1; }
  body.ib-account-mobile-ready :is(.ib-account-mobile-pills button, .ib-account-mobile-chip, .ib-account-mobile-search button, .ib-account-mobile-sort select, .ib-account-mobile-detail, .ib-account-mobile-filter-sheet button):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

  .ib-account-mobile-filter-sheet[open],
  .ib-account-mobile-detail-modal[open] { animation: ib-account-mobile-sheet-in 220ms cubic-bezier(.2,.8,.2,1); }
  @keyframes ib-account-mobile-sheet-in { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
}

@media (max-width: 360px) {
  body.ib-account-mobile-ready .ib-report-page { padding-right: 12px; padding-left: 12px; }
  body.ib-account-mobile-ready .ib-account-overview-heading h1 { font-size: 19px; }
  .ib-account-mobile-pills { gap: 6px; }
  .ib-account-mobile-pills button { gap: 4px; padding: 0 9px; font-size: 11px; }
  .ib-account-mobile-metrics dd { font-size: 12px; }
  .ib-account-mobile-filter-sheet { height: 92dvh; }
  body.ib-account-mobile-ready .ib-account-overview-filter-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ib-account-mobile-filter-sheet[open],
  .ib-account-mobile-detail-modal[open] { animation: none; }
}
