/* mobile.css — WP9. The ≤768px layer, LAST stylesheet link (base.html) so its
 * !important declarations win (build-plan §0 CSS-load-order contract). Ported
 * from eudr-x mobile.css (spec-theme §2) with chemtrust ct- selectors and navy
 * values. Geometry / breakpoints / the sheet keyframe are kept 1:1 with the
 * eudr-x source.
 *
 * env(safe-area-inset-*, fallback) is used inline instead of an @supports
 * wrapper — the fallback keeps the value valid on browsers without safe-area
 * support (equivalent effect, fewer nested blocks). base.html sets
 * viewport-fit=cover on the shell pages, so the insets are real there. Per
 * build-plan §0.8 no per-component prefers-reduced-motion blocks are added
 * (motion is neutralised globally in tokens.css).
 *
 * The phone tier (≤600px, §2.9-§2.12) follows the EUDR platform's phone
 * shell (F10): the WHOLE DOCUMENT scrolls (no box under .ct-main scrolls on
 * its own; tables keep only their sideways scroll); a 44px solid chrome bar
 * holding the logo (or a Back named after the list), search, language,
 * theme and bell, no avatar (Account is a tab); the grouped tab bar at the
 * foot (bottom-nav.css, --tabbar-h); the main area, the toasts and the
 * cookie bar kept clear of it. A kit screen's band (phone-kit.css) continues
 * the bar as one green block.
 *
 * No global 44px floor: no rule gives every button (or [role=button], a
 * checkbox, a radio) a min-height; each part sizes itself. No live blur on
 * a fixed or moving surface. */

/* ═══════════ §2.1 Touch targets + iOS anti-zoom + overflow guard ═══════════ */
@media (max-width: 768px) {
  /* Genuine tap targets grow to the 44px minimum. Inline text links are
     deliberately excluded (they'd shred line spacing); the small utility
     buttons (search-clear, toast-close, bell mark-all) are excluded too — we
     target the real ct- control classes, not a blanket `button`. */
  .ct-btn-primary,
  .ct-btn-secondary,
  .ct-btn-danger,
  .ct-btn-ghost,
  .ct-questionnaire-submit,
  select,
  .ct-chip,
  .ct-dropdown-item {
    min-height: 44px;
  }
  /* Icon-only controls need a paired min-width so the hit area is square. */
  .ct-topbar-icon-btn,
  .ct-lang-toggle,
  .ct-bell-btn,
  .ct-header-avatar {
    min-width: 44px;
    min-height: 44px;
  }
  /* Prevent iOS zoom on input focus (font-size ≥ 16px). */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  * {
    -webkit-overflow-scrolling: touch;
  }
  html,
  body {
    overflow-x: hidden;
    width: 100%;
  }
}

/* ═══════════ §2.2 Dropdown → bottom sheet ═══════════ */
@media (max-width: 768px) {
  .ct-dropdown-content {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25) !important;
    z-index: 5000 !important;
    max-height: 70vh;
    overflow-y: auto;
    animation: ctSlideUpSheet 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
  }
  /* Bottom sheet grab-handle indicator */
  .ct-dropdown-content::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(128, 128, 128, 0.3);
    border-radius: 2px;
    margin: 10px auto 6px;
  }
  .ct-dropdown-item {
    padding: 16px 20px !important;
    font-size: 1rem !important;
  }
}
@keyframes ctSlideUpSheet {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ═══════════ §2.3 Table → card transform (needs td[data-label], emitted by
   render.js table() — WP2) ═══════════ */
@media (max-width: 768px) {
  .ct-table {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: visible !important;
  }
  .ct-table thead {
    display: none !important;
  }
  .ct-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .ct-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px !important;
    padding: 16px !important;
    gap: 6px !important;
    box-shadow: var(--shadow-sm);
  }
  .ct-table td:not(.ct-table-empty) {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px;
    padding: 4px 0 !important;
    border-bottom: none !important;
    font-size: 0.88rem !important;
    box-shadow: none !important; /* drop the desktop verdict rail on first cell */
  }
  .ct-table td:not(.ct-table-empty)::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6b7c93);
    flex-shrink: 0;
    margin-right: 12px;
  }
  /* Blank the label pseudo when the cell carries no data-label (keeps flex
     spacing clean for cells rendered from a non-string header). */
  .ct-table td:not([data-label])::before {
    content: "";
    margin-right: 0;
  }
  .ct-table td:not(.ct-table-empty):last-child {
    padding-top: 10px !important;
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 4px;
  }
  /* Empty-state row keeps its centred single-cell look. */
  .ct-table-empty {
    display: block !important;
    text-align: center;
  }
}

/* ═══════════ §2.4 Buttons & sticky action bar (≤600) ═══════════ */
@media (max-width: 600px) {
  .ct-btn-primary,
  .ct-btn-secondary,
  .ct-btn-danger,
  .ct-questionnaire-submit {
    padding: 14px 24px !important;
    font-size: 0.95rem !important;
    min-height: 48px;
    border-radius: 10px !important;
  }
  /* Primary/secondary actions in a form or a page header go full-width so
     they're easy to hit and don't wrap awkwardly. */
  .ct-form .ct-btn-primary,
  .ct-form .ct-btn-secondary,
  .ct-form .ct-questionnaire-submit,
  .ct-page-actions .ct-btn-primary,
  .ct-page-actions .ct-btn-secondary {
    width: 100%;
  }
  /* Stack the page header so the title and its actions don't fight for the
     narrow width. */
  .ct-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .ct-page-actions {
    flex-wrap: wrap;
  }
  /* Optional sticky action bar utility (a page can add .ct-btn-sticky-mobile
     to a footer of actions). Solid: no live blur on a fixed surface (it
     re-ran on every scroll frame); it rests on the tab bar. A redrawn screen
     uses the kit's phSaveBar instead. */
  .ct-btn-sticky-mobile {
    position: fixed;
    bottom: calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--glass-strong);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgb(var(--storm-rgb) / 0.08);
    z-index: 100;
  }
}

/* ═══════════ §2.5 Modal centring + confirm-as-sheet (≤600) ═══════════
   Forward-looking: chemtrust has no modal/confirm DOM yet, so these are inert
   (like topbar.css's ported delete button). Present verbatim so a future
   dialog is mobile-correct with zero extra CSS. */
@media (max-width: 600px) {
  .ct-modal-box {
    width: calc(100% - 32px) !important;
    max-width: 420px !important;
    border-radius: 18px !important;
    padding: 28px 20px !important;
  }
  .ct-modal-overlay {
    align-items: center !important;
    padding: 16px;
  }
  .ct-confirm-box {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 28px 20px !important;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .ct-confirm-overlay {
    align-items: flex-end !important;
  }
  .ct-confirm-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .ct-confirm-actions button {
    width: 100% !important;
    padding: 14px 24px !important;
    font-size: 0.95rem !important;
  }
}

/* ═══════════ §2.6 Fixed-panel escape hatch — the notification bell panel is
   absolutely-positioned inside the top bar, so re-pin it to the viewport:
   under the 44px phone top bar (§2.10) and its top inset, and short enough
   to end above the tab bar. ═══════════ */
@media (max-width: 600px) {
  .ct-bell-panel {
    position: fixed !important;
    top: calc(44px + env(safe-area-inset-top, 0px) + 6px) !important;
    left: max(8px, env(safe-area-inset-left, 0px)) !important;
    right: max(8px, env(safe-area-inset-right, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(
      100dvh - 44px - env(safe-area-inset-top, 0px) - var(--tabbar-h, 60px) - env(safe-area-inset-bottom, 0px) - 18px
    ) !important;
  }
}

/* ═══════════ §2.7 Safe-area insets, print, scrollbars ═══════════ */
@media (max-width: 768px) {
  .ct-topbar {
    padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
  }
  .ct-bottom-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
  }
  /* Hide the thin scrollbars on touch (native momentum scroll stands in). */
  ::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
  }
}

/* Landscape phones are wider than 600px and keep the sidebar shell. With
   viewport-fit=cover its edges would sit under the notch and the home
   indicator, so inset the shell as the browser did before cover. On a desktop
   every inset is 0 and nothing moves. */
@media (min-width: 601px) {
  .ct-shell {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .ct-sidebar-toggle {
    margin-left: env(safe-area-inset-left, 0px);
  }
  .ct-shell .ct-sidebar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media print {
  /* Hide all app chrome. */
  .ct-topbar,
  .ct-sidebar,
  .ct-sidebar-toggle,
  .ct-bottom-footer,
  .ct-bottomnav,
  .ct-sheet,
  #cookieConsentBanner,
  .ct-toast-viewport {
    display: none !important;
  }
  /* Unclip the rigid shell so the whole document flows onto the printed page
     instead of being cropped to one 100dvh screen. */
  .ct-shell,
  .ct-right,
  .ct-shell .ct-main,
  .ct-main > #page-root,
  .ct-main > .ct-card-rigid,
  .ct-card-rigid > .ct-card-scroll {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
  }
  body.ct-shell-active {
    background: #fff !important;
  }
}

/* ═══════════ §2.8 Dark-mode × mobile pins ═══════════ */
@media (max-width: 768px) {
  body.dark-mode .ct-table tbody tr {
    background: var(--surface);
    border-color: var(--border);
  }
  body.dark-mode .ct-dropdown-content::before {
    background: var(--border-strong);
  }
}

/* ═══════════ §2.9 Shell tier — ≤600px the sidebar disappears and the
   tab bar (bottom-nav.css) takes over. mobile.css re-asserts the hides as
   the authoritative !important layer and owns the ≤600 main padding and its
   safe areas. The bottom padding keeps every screen's scroller clear of the
   tab bar and the home indicator. The footer goes too; its Privacy/Terms
   links live in the Account sheet. ═══════════ */
@media (max-width: 600px) {
  .ct-shell .ct-sidebar,
  .ct-sidebar-toggle {
    display: none !important;
  }
  .ct-bottom-footer {
    display: none !important;
  }
  .ct-shell .ct-main {
    padding-top: 10px !important;
    padding-left: max(8px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(8px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom, 0px) + 24px) !important;
  }
}

/* ═══════════ §2.10 Phone top bar — EUDR's phone bar (phone-kit.css:114-253):
   44px of solid chrome under the status bar (top inset); the brand mark on
   the left, or on a record's page a Back named after its list ("‹ Products",
   core/shell.js; a kit screen's own phBack takes the same place); then the
   search, language, theme and bell as 44px icons; no avatar (Log out and the
   profile are in the Account tab's sheet). The screen's name shows here only
   on a screen not redrawn yet: a kit screen's band carries its title. A 1px
   shadow in the bar's colour hides the seam over the band at any zoom. ═══ */

/* Desktop and tablet never show the phone-only pieces. */
.ct-topbar-home,
.ct-topbar-back {
  display: none;
}

@media (max-width: 600px) {
  .ct-shell .ct-topbar {
    height: calc(44px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(2px, env(safe-area-inset-right, 0px)) 0
      max(8px, env(safe-area-inset-left, 0px)) !important;
    gap: 0;
    border: 0;
    background: var(--chrome-bg);
    box-shadow: 0 1px 0 var(--chrome-bg);
  }

  .ct-topbar-home {
    order: 0;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 44px;
  }
  .ct-topbar-home img {
    width: 28px;
    height: 28px;
    object-fit: contain;
  }
  .ct-topbar--detail .ct-topbar-home {
    display: none;
  }

  .ct-topbar-back:not([hidden]) {
    order: 0;
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 1px;
    min-width: 44px;
    height: 44px;
    padding: 0 10px 0 0;
    color: var(--chrome-ink);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .ct-topbar-back:hover {
    color: var(--chrome-ink); /* not the global a:hover ink */
  }
  .ct-topbar-back:active {
    opacity: 0.55;
  }
  .ct-topbar-back:focus-visible,
  .ct-topbar-home:focus-visible {
    outline: 2px solid var(--chrome-active-ink);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
  }
  .ct-topbar-back svg {
    flex: none;
    width: 22px;
    height: 22px;
  }
  /* A long name ends in "…" before the bar's four icons. */
  .ct-topbar-back-label {
    min-width: 0;
    max-width: calc(100vw - 236px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* The screen's name (core/nav.js fills it), for a screen not redrawn yet.
     layout.css hides the centre slot at ≤600px; it comes back on the left. */
  .ct-topbar .ct-topbar-center {
    order: 1;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    min-width: 0;
    max-width: none;
    padding-left: 4px;
  }
  .ct-topbar .ct-topbar-title {
    color: var(--chrome-ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  /* On a record's page Back already names the list. */
  .ct-topbar--detail .ct-topbar-title {
    display: none;
  }

  .ct-topbar .ct-topbar-left {
    order: 2;
    flex: none;
    gap: 0;
    margin-left: auto;
  }
  /* No avatar on the phone: the Account tab opens the same sheet. */
  .ct-topbar .ct-topbar-right {
    display: none !important;
  }

  /* The icons: 44×44, 22px glyphs in the chrome's ink, no hover fill. */
  .ct-topbar .ct-topbar-icon-btn,
  .ct-topbar .ct-bell-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 0;
    background: none;
    color: var(--chrome-ink);
  }
  .ct-topbar .ct-topbar-icon-btn:hover,
  .ct-topbar .ct-bell-btn:hover {
    background: none;
    color: var(--chrome-ink);
  }
  .ct-topbar .ct-topbar-icon-btn:active,
  .ct-topbar .ct-bell-btn:active {
    opacity: 0.55;
  }
  .ct-topbar .ct-topbar-icon-btn svg,
  .ct-topbar .ct-bell-btn svg {
    width: 22px;
    height: 22px;
  }
  /* The language: the flag and the language it switches to. */
  .ct-topbar .ct-lang-toggle {
    width: auto;
    padding: 0 6px;
    gap: 5px;
    color: var(--chrome-ink);
    font-size: 13px;
    font-weight: 800;
  }
  .ct-topbar .ct-lang-toggle:hover {
    background: none;
    color: var(--chrome-ink);
  }
  .ct-topbar .ct-bell-badge {
    top: 6px;
    right: 5px;
    box-shadow: 0 0 0 2px var(--chrome-bg);
  }

  /* Search: the first tap types (the invisible input covers the magnifier;
     topbar.css only reveals it on :hover, which a tap cannot reach first),
     and the open field lies over the whole bar instead of pushing it aside. */
  .ct-topbar .ct-global-search,
  .ct-topbar .ct-global-search:hover {
    position: relative;
    width: 44px;
    height: 44px;
  }
  .ct-topbar .ct-global-search .ct-global-search__field {
    position: relative;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
  }
  .ct-topbar .ct-global-search .ct-global-search__icon {
    width: 22px;
    height: 22px;
    color: var(--chrome-ink);
  }
  .ct-topbar .ct-global-search .ct-global-search__input {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    pointer-events: auto;
    caret-color: var(--highlight);
    cursor: pointer;
  }
  .ct-topbar .ct-global-search .ct-global-search__clear {
    display: none;
  }
  .ct-topbar .ct-global-search:focus-within,
  .ct-topbar .ct-global-search.has-text {
    position: absolute;
    z-index: 5;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    width: auto;
    height: 44px;
    padding: 4px max(8px, env(safe-area-inset-right, 0px)) 4px max(8px, env(safe-area-inset-left, 0px));
    background: var(--chrome-bg);
  }
  .ct-topbar .ct-global-search:focus-within .ct-global-search__field,
  .ct-topbar .ct-global-search.has-text .ct-global-search__field {
    justify-content: flex-start;
    gap: 6px;
    padding: 0 6px 0 10px;
    border: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--chrome-ink) 13%, transparent);
    cursor: text;
  }
  .ct-topbar .ct-global-search:focus-within .ct-global-search__icon,
  .ct-topbar .ct-global-search.has-text .ct-global-search__icon {
    width: 16px;
    height: 16px;
    color: var(--chrome-sec);
  }
  .ct-topbar .ct-global-search:focus-within .ct-global-search__input,
  .ct-topbar .ct-global-search.has-text .ct-global-search__input {
    position: static;
    opacity: 1;
    cursor: text;
  }
  .ct-topbar .ct-global-search:focus-within .ct-global-search__clear,
  .ct-topbar .ct-global-search.has-text .ct-global-search__clear {
    display: flex;
    width: 32px;
    height: 32px;
    opacity: 1;
    pointer-events: auto;
  }
  .ct-topbar .ct-global-search__menu {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    max-height: calc(
      100dvh - 44px - env(safe-area-inset-top, 0px) - var(--tabbar-h, 60px) - env(safe-area-inset-bottom, 0px) - 24px
    );
  }
}

/* ═══════════ §2.11 Toasts above the tab bar — ui.css pins the viewport to
   the bottom-right at z-index 1000, under the bar (1500). On a phone with the
   bar they span the width just above it. ═══════════ */
@media (max-width: 600px) {
  body.ct-has-tabbar .ct-toast-viewport {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom, 0px) + 12px);
    width: auto;
    max-width: none;
    z-index: 1600;
  }
}

/* ── Phone polish (2026-11-09 sweep) ── */
@media (max-width: 600px) {
  /* The cookie bar sat on top of the tab bar until accepted, hiding the
     navigation. On app pages it rests just above the bar; everywhere it clears
     the home indicator. */
  #cookieConsentBanner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  body.ct-shell-active:not([data-public-page]) #cookieConsentBanner {
    bottom: calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom, 0px));
    padding-bottom: 16px;
  }
  /* Record pages carried two Backs on a phone: the named one in the top bar
     and the page's own "← Back to list". Keep the top bar's. */
  body:has(.ct-topbar-back:not([hidden])) .ct-page-back {
    display: none;
  }
}

/* ── The page head and list toolbar on a phone (EUDR admin-phone.css) ──
   No page card (layout.css keeps it ≥601px) and no badge: the title is the
   screen's name under the bar. The toolbar's search takes the full width,
   its dropdowns two to a row, the count on its own line; row actions grow
   to 44px targets. */
@media (max-width: 600px) {
  .ct-page-icon {
    display: none;
  }
  .ct-page-title {
    font-size: 1.25rem;
  }
  .ct-toolbar {
    padding: 8px;
  }
  .ct-toolbar-search {
    flex-basis: 100%;
  }
  .ct-toolbar-search-input,
  .ct-toolbar-select,
  .ct-search-input {
    height: 44px;
  }
  .ct-toolbar-select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    max-width: none;
  }
  .ct-toolbar-count {
    flex-basis: 100%;
    margin-left: 0;
  }
  .ct-icon-btn {
    width: 44px;
    height: 44px;
  }
  .ct-count-link,
  .ct-page-back {
    min-width: 44px;
    min-height: 44px;
  }
  .ct-page-context {
    padding: 8px 10px;
  }
}

/* ═══════════ §2.12 The whole document scrolls (≤600px) — F10; EUDR
   responsive.css:15-92 and the chain rule at its mobile.css:1516-1534.
   A desktop or a tablet is an app frame: the page card fills the window and
   only its list scrolls inside it. On a phone that left a strip of list
   under the page head, and only a window that scrolls gets the browser's own
   scroll restore on Back and from the bfcache. So here the window scrolls:
   - html scrolls and body does not: a body that is its own scroll box pins
     the sticky top bar to a box that never scrolls (body clips sideways
     with `clip`, which makes no scroll box; older engines drop it and keep
     `visible`);
   - every box between the frame and the content takes its content's height
     TOGETHER (flex:0 0 auto): one left at flex:1 1 0 inside a content-sized
     parent collapses to 0 and its children escape it;
   - lists and panels stop scrolling inside cards; tables keep only their
     sideways scroll.
   The top bar stays pinned (sticky), the tab bar floats over the page. ═══ */
@media (max-width: 600px) {
  html {
    overflow-x: hidden;
    overflow-y: auto;
  }
  /* Overscroll and the gap before paint show the bar's green, never white. */
  html:has(> body.ct-shell-active:not([data-public-page])) {
    background: var(--brand-storm);
  }
  body.ct-shell-active {
    overflow: visible !important;
    overflow-x: clip !important;
  }
  .ct-shell,
  .ct-shell .ct-right {
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible !important;
  }
  .ct-shell .ct-main {
    flex: 1 0 auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  .ct-shell .ct-main > #page-root,
  .ct-shell .ct-main > .ct-card-rigid,
  .ct-shell .ct-main .ct-card-rigid > .ct-card-scroll {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  /* Panels that scroll inside a card on larger screens. */
  .ct-main .ct-home-regwatch-body,
  .ct-main .ct-mail-body {
    max-height: none !important;
    overflow: visible !important;
  }
  /* Sideways only: tables and tab strips, never a height limit. */
  .ct-main .ct-table-scroll,
  .ct-main .ct-tabs {
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
}
