
:root { --sd-tabbar-h: 62px; --sd-accent: #312e81; }
html { -webkit-tap-highlight-color: transparent; }
body { touch-action: manipulation; }
.sd-only-mobile { display: none !important; }
.sd-offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 2000; padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top)); background: #b91c1c; color: #fff; font-size: 14px; font-weight: 600; text-align: center; }
.sd-offline-bar[hidden] { display: none; }

/* Bottom sheet (create menu, more menu) */
.sd-sheet-backdrop { position: fixed; inset: 0; z-index: 1990; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; }
.sd-sheet-backdrop[hidden] { display: none; }
.sd-sheet { width: 100%; max-width: 640px; max-height: 80vh; overflow: auto; overscroll-behavior: contain; background: var(--bs-body-bg, #fff); color: var(--bs-body-color); border-radius: 18px 18px 0 0; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
.sd-sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: #cbd5e1; margin: 4px auto 10px; }
.sd-sheet h6 { margin: 4px 18px 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.sd-sheet a, .sd-sheet button.sd-sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 20px; border: 0; background: none; color: inherit; text-decoration: none; font-size: 16px; text-align: left; }
.sd-sheet a:active, .sd-sheet button.sd-sheet-item:active { background: rgba(49, 46, 129, .08); }
.sd-sheet i { font-size: 20px; width: 24px; text-align: center; color: var(--sd-accent); }
[data-bs-theme="dark"] .sd-sheet i { color: #a5b4fc; }

@media (max-width: 767.98px) {
  .sd-only-mobile { display: initial !important; }
  .sd-hide-mobile { display: none !important; }
  body { padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
  .navbar-modern { padding-top: calc(.35rem + env(safe-area-inset-top)) !important; padding-bottom: .35rem !important; }
  .navbar-modern .navbar-brand { font-size: 1.05rem !important; }
  .navbar-modern .navbar-collapse { max-height: calc(100vh - 120px); overflow-y: auto; }
  .navbar-modern .nav-link, .navbar-modern .dropdown-item { min-height: 46px; display: flex; align-items: center; gap: 8px; }
  .container, .container-fluid { padding-left: 12px !important; padding-right: 12px !important; }
  .container.py-4 { padding-top: 12px !important; }
  h1, .h1 { font-size: 1.5rem; } h2, .h2 { font-size: 1.3rem; } h3, .h3 { font-size: 1.15rem; }

  /* Forms: 16px text so iOS does not zoom, full-width controls, comfortable targets */
  input.form-control, select.form-select, textarea.form-control, .select2-selection, input[type="date"], input[type="text"], input[type="number"], input[type="tel"], input[type="email"], input[type="search"], input[type="password"], select, textarea { font-size: 16px !important; }
  .form-control, .form-select { min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .card-header, .d-flex.justify-content-between { flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px; }
  .btn-group, .btn-toolbar, .filter-btn-group, .d-flex.gap-1, .d-flex.gap-2, .d-flex.gap-3 { flex-wrap: wrap; }
  img, video, canvas, iframe { max-width: 100%; }
  .select2-container { width: 100% !important; }
  .daterangepicker { left: 8px !important; right: 8px !important; width: auto !important; }
  .daterangepicker .drp-calendar { max-width: none !important; width: 100%; float: none !important; }
  .daterangepicker .ranges { float: none !important; width: 100%; }

  /* Pop-ups go full screen, with the title bar and buttons always reachable */
  .modal-dialog { margin: 0 !important; max-width: none !important; width: 100vw; height: 100%; }
  .modal-content { min-height: 100dvh; border: 0 !important; border-radius: 0 !important; }
  .modal-header { position: sticky; top: 0; z-index: 2; background: var(--bs-body-bg, #fff); padding-top: calc(1rem + env(safe-area-inset-top)); }
  .modal-footer { position: sticky; bottom: 0; z-index: 2; background: var(--bs-body-bg, #fff); padding-bottom: calc(.75rem + env(safe-area-inset-bottom)); }

  /* Tables become cards: each row a card, each cell labelled from the header (mobile.js adds the
     labels). A table can opt out with data-sd-table="keep" and keeps horizontal scrolling. */
  table.sd-cards { border: 0 !important; background: transparent !important; }
  table.sd-cards thead { display: none; }
  table.sd-cards, table.sd-cards tbody, table.sd-cards tr, table.sd-cards td, table.sd-cards th { display: block; width: 100% !important; }
  table.sd-cards tbody tr { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--bs-border-color, #e5e7eb); border-radius: 12px; background: var(--bs-body-bg, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
  table.sd-cards tbody td, table.sd-cards tbody th { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 5px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; word-break: normal; overflow-wrap: break-word; flex-wrap: wrap; min-height: 0; }
  table.sd-cards tbody td::before, table.sd-cards tbody th::before { content: attr(data-label); flex: 0 0 40%; max-width: 40%; text-align: left; font-size: 12.5px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .02em; }
  table.sd-cards tbody td[data-label=""]::before, table.sd-cards tbody th[data-label=""]::before { display: none; }
  table.sd-cards tbody td[data-label=""] { justify-content: flex-end; }
  table.sd-cards tbody td[colspan] { justify-content: center; text-align: center; }
  table.sd-cards tbody td[colspan]::before { display: none; }
  table.sd-cards tbody td:first-child { font-weight: 700; font-size: 15.5px; }
  table.sd-cards tbody td .btn { min-height: 38px; }
  table.sd-cards tbody td input[type="checkbox"] { width: 22px; height: 22px; }
  .table-responsive:has(> table.sd-cards) { overflow: visible !important; }
  table.sd-cards tfoot { display: block; }
  table.sd-cards tfoot tr { display: flex; flex-wrap: wrap; gap: 6px; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .pagination .page-link { min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }

  /* Bottom tab bar */
  .sd-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex !important; height: calc(var(--sd-tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bs-body-bg, #fff); border-top: 1px solid var(--bs-border-color, #e5e7eb); box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
  .sd-tabbar a, .sd-tabbar button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: #64748b; font-size: 11.5px; font-weight: 600; text-decoration: none; min-width: 0; }
  .sd-tabbar i { font-size: 21px; line-height: 1; }
  .sd-tabbar .active { color: var(--sd-accent); }
  [data-bs-theme="dark"] .sd-tabbar .active { color: #a5b4fc; }
  .sd-tabbar .sd-tab-new i { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%; background: var(--sd-accent); color: #fff; font-size: 24px; box-shadow: 0 6px 16px rgba(49,46,129,.35); }
  .toast-container { bottom: calc(env(safe-area-inset-bottom) + 12px) !important; }
}

/* ── Modern phone & tablet skin (2026-10-23), the TexCoat app's look: light surfaces, soft tinted icon
   tiles, 18px rounded cards, bold labels, big touch targets; follows the CRMS light/dark switch.
   Only below 992px — the desktop keeps its own look. "html body" outranks the monthly-theme styles. */
:root { --m-bg:#f3f5fa; --m-surface:#fff; --m-surface-2:#eef2f8; --m-ink:#0f172a; --m-ink-soft:#5b6b82; --m-line:#e1e7f0;
  --m-brand:#312e81; --m-brand-soft:#e9e8fb; --m-danger:#b42318; --m-danger-soft:#fdecea; --m-warn:#8a5a00; --m-warn-soft:#fff4d6;
  --m-ok:#157a3c; --m-ok-soft:#e2f5e9; --m-info:#1d4f91; --m-info-soft:#e5eefb; --m-shadow:0 1px 2px rgba(15,23,42,.05),0 4px 16px rgba(15,23,42,.05); }
[data-bs-theme="dark"] { --m-bg:#0c1118; --m-surface:#151c26; --m-surface-2:#1c2531; --m-ink:#e8edf4; --m-ink-soft:#97a6ba; --m-line:#263142;
  --m-brand:#8b8cf6; --m-brand-soft:#23234a; --m-danger:#ff8a7f; --m-danger-soft:#3a1d1a; --m-warn:#f2c35b; --m-warn-soft:#362d17;
  --m-ok:#6fd394; --m-ok-soft:#15301f; --m-info:#8db8f2; --m-info-soft:#1a2a40; --m-shadow:none; }
@keyframes m-appear { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@media (max-width: 991.98px) {
  html body { background: var(--m-bg) !important; color: var(--m-ink); font-size: 16px; -webkit-text-size-adjust: 100%; }
  html body .container.py-4 { animation: m-appear .16s ease-out; }
  /* top bar: translucent surface, dark brand — like TexCoat */
  html body .navbar-modern { background: color-mix(in srgb, var(--m-surface) 88%, transparent) !important; backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--m-line) !important; box-shadow: none !important; }
  html body .navbar-modern .navbar-brand { color: var(--m-ink) !important; font-weight: 800; }
  html body .navbar-modern .navbar-brand i { color: var(--m-brand) !important; }
  /* page titles: plain, bold, no dark banner */
  html body .page-header, html body .dashboard-header { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 4px 2px 0 !important; margin: 0 0 14px !important; border-radius: 0 !important; }
  html body .page-header h1, html body .page-header h2, html body .page-header h3, html body .dashboard-header h1 { color: var(--m-ink) !important; font-size: 1.35rem !important; font-weight: 800 !important; }
  html body .page-header p, html body .page-header .text-muted, html body .dashboard-header p { color: var(--m-ink-soft) !important; opacity: 1 !important; }
  html body .page-header i, html body .dashboard-header i { color: var(--m-brand) !important; }
  html body .dashboard-header .btn { min-height: 40px; }
  /* cards and panels */
  html body .card, html body .ur-card, html body .ur-area { background: var(--m-surface) !important; border: 1px solid var(--m-line) !important; border-radius: 18px !important; box-shadow: var(--m-shadow) !important; }
  html body .card-header { background: transparent !important; border-bottom: 1px solid var(--m-line) !important; font-weight: 800; }
  html body .section-title { border: 0 !important; margin: 22px 2px 10px !important; padding: 0 !important; font-size: 1.1rem; font-weight: 800; color: var(--m-ink); }
  html body .section-header-bar { background: var(--m-surface) !important; color: var(--m-ink) !important; border: 1px solid var(--m-line) !important; border-radius: 16px !important; box-shadow: var(--m-shadow) !important; }
  html body .section-header-bar h5 { color: var(--m-ink) !important; font-weight: 800; }
  /* figures row → tiles: big number, label underneath, tinted by kind; an odd last tile spans the row */
  html body #sdSummary .row-gap-consistent { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px !important; }
  html body #sdSummary .row-gap-consistent > [class*="col"] { width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
  html body #sdSummary .row-gap-consistent > [class*="col"]:last-child:nth-child(odd) { grid-column: 1 / -1; }
  html body #sdSummary .row-gap-consistent .action-card { display: grid !important; align-content: center; justify-content: start !important; justify-items: start; gap: 2px; min-height: 104px; padding: 16px !important; text-align: left !important;
    background: var(--m-surface) !important; border: 1px solid var(--m-line) !important; border-left-width: 1px !important; border-radius: 18px !important; box-shadow: var(--m-shadow) !important; position: relative; overflow: hidden; }
  html body #sdSummary .row-gap-consistent .action-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--m-brand); }
  html body #sdSummary .row-gap-consistent .action-card.border-danger::before { background: var(--m-danger); }
  html body #sdSummary .row-gap-consistent .action-card.border-warning::before { background: #d97706; }
  html body #sdSummary .row-gap-consistent .action-card.border-info::before { background: #0891b2; }
  html body #sdSummary .row-gap-consistent .action-card.border-success::before { background: var(--m-ok); }
  html body #sdSummary .row-gap-consistent .action-card h3 { font-size: 2rem !important; font-weight: 800 !important; margin: 0 !important; line-height: 1.1; font-variant-numeric: tabular-nums; }
  html body #sdSummary .row-gap-consistent .action-card p { color: var(--m-ink-soft) !important; font-size: .86rem !important; font-weight: 700 !important; }
  /* quick actions → TexCoat tiles: tinted icon square, bold label */
  html body .action-card.d-block { display: grid !important; justify-content: start !important; justify-items: start; align-content: start; gap: 8px; min-height: 116px; padding: 16px !important; text-align: left;
    background: var(--m-surface) !important; border: 1px solid var(--m-line) !important; border-radius: 18px !important; box-shadow: var(--m-shadow) !important; transition: transform .08s, border-color .15s; }
  html body .action-card.d-block:active { transform: scale(.98); }
  html body .action-card.d-block > div:first-child { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 !important; font-size: 1.6rem !important; background: var(--m-brand-soft); }
  html body .action-card.d-block > .text-danger { background: var(--m-danger-soft); }
  html body .action-card.d-block > .text-success { background: var(--m-ok-soft); }
  html body .action-card.d-block > .text-warning { background: var(--m-warn-soft); }
  html body .action-card.d-block > .text-info { background: var(--m-info-soft); }
  html body .action-card.d-block > .text-secondary { background: var(--m-surface-2); }
  html body .action-card.d-block h6 { font-size: 1rem !important; font-weight: 800 !important; color: var(--m-ink) !important; text-align: left; }
  /* filter rows → chips */
  html body .date-filter-bar { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
  html body .filter-btn { border-radius: 999px !important; border: 1px solid var(--m-line) !important; background: var(--m-surface-2) !important; color: var(--m-ink) !important; font-weight: 600; min-height: 40px; padding: 6px 14px !important; }
  html body .filter-btn.active { background: var(--m-brand) !important; border-color: var(--m-brand) !important; color: #fff !important; }
  /* buttons and fields: bigger, rounder */
  html body .btn { border-radius: 14px; font-weight: 700; }
  html body .btn-sm { border-radius: 12px; }
  html body .form-control, html body .form-select { border-radius: 12px !important; border: 1.5px solid var(--m-line) !important; min-height: 50px; background-color: var(--m-surface) !important; color: var(--m-ink) !important; }
  html body .form-control:focus, html body .form-select:focus { border-color: var(--m-brand) !important; box-shadow: 0 0 0 4px var(--m-brand-soft) !important; }
  html body .form-label { font-weight: 700; color: var(--m-ink); }
  html body .badge { border-radius: 999px; font-weight: 700; }
  html body .alert { border-radius: 14px; }
  /* tables-as-cards in the same card language */
  html body table.sd-cards tbody tr { border-radius: 16px !important; border-color: var(--m-line) !important; background: var(--m-surface) !important; box-shadow: var(--m-shadow) !important; }
  /* tab bar & sheets in the same palette */
  html body .sd-tabbar { background: color-mix(in srgb, var(--m-surface) 92%, transparent) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top-color: var(--m-line) !important; }
  html body .sd-sheet { background: var(--m-surface) !important; color: var(--m-ink) !important; }
}
/* Phones & tablets move around as ClinicOS does: the home tiles are the menu, every other screen has
   a back arrow, and the account button holds only the account (install, theme, sign out). */
.sd-back, .sd-acct, .sd-fab-summary { display: none; }
@media (max-width: 991.98px) {
  html body .navbar-modern .navbar-toggler, html body .navbar-modern .navbar-collapse { display: none !important; }
  html body .navbar-modern .container-fluid { flex-wrap: nowrap; gap: 6px; }
  html body .navbar-modern .navbar-brand { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sd-back { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; border-radius: 12px; color: var(--m-ink) !important; text-decoration: none; font-size: 1.35rem; flex: 0 0 auto; }
  .sd-back:active { background: var(--m-surface-2); }
  .sd-acct { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--m-brand); color: #fff; font-weight: 800; font-size: .85rem; }
  .sd-acct-who { display: grid; gap: 2px; padding: 4px 20px 10px; border-bottom: 1px solid var(--m-line); margin-bottom: 4px; }
  .sd-acct-who span { color: var(--m-ink-soft); font-size: .88rem; }
  /* the round Summary button, bottom centre (where the + was) */
  html body:has(.sd-fab-summary) { padding-bottom: calc(env(safe-area-inset-bottom) + 96px) !important; }
  .sd-fab-summary { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 1030;
    display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px 0 18px; border-radius: 999px;
    background: var(--m-brand); color: #fff !important; text-decoration: none !important; font-weight: 800; font-size: 1rem;
    box-shadow: 0 8px 22px rgba(49,46,129,.38); -webkit-tap-highlight-color: transparent; }
  .sd-fab-summary i { font-size: 1.3rem; }
  .sd-fab-summary:active { transform: translateX(-50%) scale(.97); }
  .toast-container { bottom: calc(env(safe-area-inset-bottom) + 82px) !important; }
  /* step aside for a screen's own bottom bar (Save permissions, selected cards) */
  html body:has(#urMatrixCard:not([hidden])) .sd-fab-summary, html body:has(#bulkActionsBar:not(.d-none)) .sd-fab-summary { display: none; }
}
@media print { .sd-fab-summary { display: none !important; } }

/* Home: APPS | SUMMARY (phones & tablets), as in ClinicOS. Desktop keeps the dashboard as it is. */
.sd-home-tabs, .sd-apps { display: none !important; }
@media (max-width: 991.98px) {
  html body .sd-home-tabs { display: grid !important; grid-template-columns: 1fr 1fr; margin: -12px -12px 6px; background: var(--m-brand);
    position: sticky; top: var(--sd-nav-h, 56px); z-index: 1020; }
  html body .sd-home-tabs button { border: 0; background: none; color: rgba(255,255,255,.62); font: inherit; font-weight: 800; font-size: 14px; letter-spacing: .04em;
    text-transform: uppercase; height: 48px; border-bottom: 3px solid transparent; cursor: pointer; min-width: 0; }
  html body .sd-home-tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
  html body .sd-apps { display: block !important; padding: 0 0 24px; animation: m-appear .16s ease-out; }
  html body .sd-apps[hidden] { display: none !important; }
  html body:not(.sd-show-summary) #sdSummary { display: none; }
  /* Summary is the figures: its Quick Actions repeat the Apps tab, so they go on phones */
  html body #sdSummary .section-title:has(.bi-lightning-charge), html body #sdSummary .section-title:has(.bi-lightning-charge) + .row { display: none !important; }
  .sd-tile-head { font-size: 1.15rem; font-weight: 500; color: var(--m-ink-soft); padding: 16px 6px 2px; }
  .sd-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sd-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0; padding: 6px 4px 10px; border-radius: 12px;
    color: var(--m-ink) !important; text-decoration: none !important; -webkit-tap-highlight-color: transparent; }
  .sd-tile:active { background: var(--m-surface-2); }
  .sd-tile-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--m-brand-soft); color: var(--m-brand); }
  .sd-tile-ico i { font-size: 30px; line-height: 1; }
  .sd-tile-name { font-size: 14.5px; font-weight: 700; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
}
@media (min-width: 600px) and (max-width: 991.98px) { .sd-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 359.98px) { .sd-tile-ico { width: 54px; height: 54px; } .sd-tile-ico i { font-size: 26px; } .sd-tile-name { font-size: 13px; } }

/* Forms on phones: one field per row, label above, control full width — every search and create page.
   Pages use fixed two- and three-column rows (col-6, col-4, col) that squeeze a dropdown to 120px and
   a date box to "Fro"; here every column stacks. Tile grids keep their own layout. */
@media (max-width: 767.98px) {
  html body .container .row:not(.text-center):not(.sd-keep-cols):not(#sdSummary .row-gap-consistent) > [class*="col"] { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
  html body .container .row:not(.text-center) { --bs-gutter-x: 0; row-gap: 14px; }
  html body .container .row > [class*="col"] > label, html body .form-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; line-height: 1.3; }
  html body .container .row > [class*="col"]:empty { display: none; }
  /* a from–to pair stays on one line, each box half the width */
  html body .input-group { flex-wrap: nowrap; }
  html body .input-group > .form-control, html body .input-group > .form-select { min-width: 0; flex: 1 1 0; }
  html body .d-flex:has(> input[type="date"] + span, > input + .mx-1, > input + .text-muted) > input { flex: 1 1 0; min-width: 0; }
  html body .select2-container .select2-selection--single { height: 50px !important; display: flex; align-items: center; border-radius: 12px !important; border: 1.5px solid var(--m-line) !important; }
  html body .select2-container .select2-selection__rendered { line-height: 1.3 !important; padding-left: 14px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body .select2-container .select2-selection__arrow { height: 48px !important; }
  html body select[multiple].form-control, html body select[multiple].form-select { min-height: 160px; }
  /* form buttons share the row evenly, full height */
  html body form .d-flex > .btn, html body .card-body > .d-flex > .btn, html body form .text-end > .btn, html body form .text-center > .btn { flex: 1 1 100%; min-width: 0; min-height: 52px; white-space: nowrap; }
  html body form .btn > i.d-block { display: inline-block !important; margin: 0 6px 0 0 !important; }
  html body form .text-end, html body form .text-center { display: flex; gap: 10px; flex-wrap: wrap; }
  /* page titles start on the left, like every other screen */
  html body .container > .text-center:first-child, html body .page-header .text-center, html body .page-header.text-center { text-align: left !important; }
  html body .page-header .d-flex { justify-content: flex-start !important; }
}

/* tablets: three tiles a row for figures and quick actions */
@media (min-width: 600px) and (max-width: 991.98px) {
  html body #sdSummary .row-gap-consistent { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body #sdSummary .row-gap-consistent > [class*="col"]:last-child:nth-child(odd) { grid-column: auto; }
  html body .row.text-center > .col-6 { width: 33.333% !important; }
}
/* very small phones (320–359px): one tile a row */
@media (max-width: 359.98px) {
  html body #sdSummary .row-gap-consistent { grid-template-columns: 1fr; }
  html body .row.text-center > .col-6 { width: 100% !important; }
}
@media (prefers-reduced-motion: reduce) { html body .container.py-4 { animation: none; } }
@media print { .sd-tabbar, .sd-sheet-backdrop, .sd-offline-bar { display: none !important; } }
