/*
 * SMAIS Native App Layer
 * Shared interaction and layout treatment for the PWA shell.
 * Loaded after legacy/page-specific styles so the existing features remain intact.
 */

:root {
  --smais-app-bg: #08090b;
  --smais-app-surface: rgba(25, 26, 30, 0.94);
  --smais-app-surface-2: rgba(35, 36, 41, 0.92);
  --smais-app-line: rgba(255, 255, 255, 0.10);
  --smais-app-line-strong: rgba(233, 197, 111, 0.28);
  --smais-app-text: rgba(255, 255, 255, 0.96);
  --smais-app-muted: rgba(255, 255, 255, 0.58);
  --smais-app-accent: #e2bd68;
  --smais-app-accent-ink: #1b1204;
  --smais-app-danger: #ff6472;
  --smais-app-radius: 18px;
  --smais-app-topbar-height: 58px;
}

html.smais-native-ui {
  background: var(--smais-app-bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

html.smais-native-ui,
html.smais-native-ui body {
  overscroll-behavior-x: none;
}

html.smais-native-ui body {
  background:
    radial-gradient(circle at 50% -14%, rgba(226, 189, 104, 0.11), transparent 33%),
    linear-gradient(180deg, #0c0d10 0%, var(--smais-app-bg) 44%, #050506 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.smais-native-ui button,
html.smais-native-ui a,
html.smais-native-ui input,
html.smais-native-ui select,
html.smais-native-ui textarea,
html.smais-native-ui summary {
  -webkit-tap-highlight-color: transparent;
}

html.smais-native-ui button,
html.smais-native-ui a,
html.smais-native-ui summary {
  touch-action: manipulation;
}

html.smais-native-ui button,
html.smais-native-ui [role="button"],
html.smais-native-ui .dashboard-card,
html.smais-native-ui .cast-back-link {
  transition:
    transform 0.13s cubic-bezier(.2,.8,.2,1),
    opacity 0.13s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

html.smais-native-ui .smais-native-pressed,
html.smais-native-ui button:active,
html.smais-native-ui a:active,
html.smais-native-ui [role="button"]:active {
  transform: scale(0.975);
  opacity: 0.88;
}

html.smais-native-ui body.smais-native-leaving {
  pointer-events: none;
}

html.smais-native-ui body.smais-native-leaving main,
html.smais-native-ui body.smais-native-leaving .dashboard-main {
  animation: smaisNativeLeave 0.18s ease forwards;
}

@keyframes smaisNativeLeave {
  to { opacity: 0; transform: translateX(-10px); }
}

/* Subpage shell --------------------------------------------------------- */
@media (max-width: 900px) {
  body.cast-subpage,
  body.webedit-page {
    min-height: 100dvh;
    background: var(--smais-app-bg) !important;
  }

  body.cast-subpage > .cast-page-shell {
    width: 100%;
    max-width: 760px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 0 12px 24px !important;
    scroll-padding-top: calc(var(--smais-app-topbar-height) + env(safe-area-inset-top, 0px));
  }

  /* style.css has a more specific status-bar padding rule with !important.
     Override it explicitly so the app bar stays in normal document flow. */
  body.smais-offset-statusbar.cast-subpage > .cast-page-shell {
    padding-top: 0 !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) {
    position: sticky !important;
    top: 0;
    z-index: 2147481500;
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) 86px !important;
    align-items: center !important;
    width: calc(100% + 24px);
    min-height: calc(var(--smais-app-topbar-height) + env(safe-area-inset-top, 0px));
    margin: 0 -12px 16px !important;
    box-sizing: border-box;
    padding:
      env(safe-area-inset-top, 0px)
      max(10px, env(safe-area-inset-right, 0px))
      0
      max(10px, env(safe-area-inset-left, 0px)) !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 0 !important;
    background: rgba(10, 11, 14, 0.83) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    backdrop-filter: blur(24px) saturate(1.3);
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header)::before,
  body.cast-subpage .cast-page-header:not(.guide-page-header)::after {
    display: none !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) > .cast-page-title-icon {
    display: none !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) > div:not(.profile-header-actions) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0;
    text-align: center !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) .cast-page-kicker,
  body.cast-subpage .cast-page-header:not(.guide-page-header) > div:not(.profile-header-actions) > p:not(.cast-page-kicker) {
    display: none !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) h1 {
    margin: 0 !important;
    overflow: hidden;
    color: var(--smais-app-text) !important;
    font-size: 17px !important;
    font-weight: 790 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.01em !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) > .cast-back-link,
  body.cast-subpage .cast-page-header:not(.guide-page-header) .profile-header-actions .cast-back-link:last-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    display: inline-flex !important;
    align-items: center;
    gap: 2px;
    min-width: 70px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 8px 0 3px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #f2cf7f !important;
    font-size: 14px !important;
    font-weight: 720 !important;
    text-decoration: none !important;
    letter-spacing: 0 !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) > .cast-back-link::before,
  body.cast-subpage .cast-page-header:not(.guide-page-header) .profile-header-actions .cast-back-link:last-child::before {
    content: "";
    width: 9px;
    height: 9px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) .profile-header-actions {
    display: contents !important;
  }

  body.cast-subpage .cast-page-header:not(.guide-page-header) .profile-header-actions .cast-back-link:first-child:not(:last-child) {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 58px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 9px !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 12px !important;
    font-weight: 760 !important;
  }

  /* Guide pages use a custom hero. Keep its identity but make it an app screen. */
  body.cast-subpage .guide-page-header {
    margin: 0 0 12px !important;
    padding: 18px !important;
    border-radius: 20px !important;
  }

  body.cast-subpage .guide-page-header .guide-hero-back {
    min-height: 42px;
  }

  body.cast-subpage .cast-panel,
  body.cast-subpage .cast-wide-panel,
  body.cast-subpage .dashboard-section {
    border: 1px solid var(--smais-app-line) !important;
    border-radius: var(--smais-app-radius) !important;
    background: var(--smais-app-surface) !important;
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.cast-subpage .cast-panel {
    padding: 17px !important;
  }

  body.cast-subpage .cast-panel + .cast-panel,
  body.cast-subpage .cast-panel + .cast-card-grid,
  body.cast-subpage .cast-card-grid + .cast-panel {
    margin-top: 12px !important;
  }

  body.cast-subpage .cast-panel h2,
  body.cast-subpage .cast-panel h3 {
    letter-spacing: 0.015em !important;
  }

  body.cast-subpage .cast-panel p,
  body.cast-subpage .muted,
  body.cast-subpage .form-help {
    color: var(--smais-app-muted) !important;
  }

  body.cast-subpage input,
  body.cast-subpage select,
  body.cast-subpage textarea {
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 13px !important;
    background: rgba(255, 255, 255, 0.065) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
    color: var(--smais-app-text) !important;
    font-size: 16px !important;
  }

  body.cast-subpage textarea {
    min-height: 120px;
  }

  body.cast-subpage input:focus,
  body.cast-subpage select:focus,
  body.cast-subpage textarea:focus {
    border-color: rgba(226, 189, 104, 0.66) !important;
    box-shadow: 0 0 0 3px rgba(226, 189, 104, 0.13) !important;
  }

  body.cast-subpage .cast-primary-button,
  body.cast-subpage button[type="submit"] {
    min-height: 50px;
    border-radius: 15px !important;
    font-weight: 820 !important;
    letter-spacing: 0.015em !important;
  }

  body.cast-subpage .cast-mini-card,
  body.cast-subpage .profile-fact-card,
  body.cast-subpage .profile-stat-card,
  body.cast-subpage .teleport-launch-panel,
  body.cast-subpage .attraction-guide-panel {
    border-color: var(--smais-app-line) !important;
    background: var(--smais-app-surface-2) !important;
  }

  /* Mobile modals become bottom sheets instead of desktop dialogs. */
  body.cast-subpage .teleport-modal-box,
  body.cast-subpage .notice-modal-panel,
  body.cast-subpage .rules-modal-panel,
  body.cast-subpage .history-detail-modal-panel,
  body.cast-subpage .cast-member-modal-box,
  body.cast-subpage .attraction-modal-panel,
  body.cast-subpage .attraction-lock-admin-modal-panel,
  body.cast-subpage .application-modal-panel,
  body.cast-subpage .passkey-first-modal-panel {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: min(88dvh, 850px) !important;
    margin: 0 !important;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    background: rgba(20, 21, 25, 0.98) !important;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.62) !important;
  }

  body.cast-subpage .teleport-modal-box::before,
  body.cast-subpage .notice-modal-panel::before,
  body.cast-subpage .rules-modal-panel::before,
  body.cast-subpage .history-detail-modal-panel::before,
  body.cast-subpage .cast-member-modal-box::before,
  body.cast-subpage .attraction-modal-panel::before,
  body.cast-subpage .application-modal-panel::before {
    content: "";
    display: block;
    width: 38px;
    height: 5px;
    margin: 8px auto 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.23);
  }

  body.cast-subpage .teleport-modal:not([hidden]) .teleport-modal-box,
  body.cast-subpage .notice-modal.is-open .notice-modal-panel,
  body.cast-subpage .rules-modal.is-open .rules-modal-panel,
  body.cast-subpage .history-detail-modal.is-open .history-detail-modal-panel,
  body.cast-subpage .cast-member-modal.is-open .cast-member-modal-box,
  body.cast-subpage .attraction-operation-modal.is-open .attraction-modal-panel,
  body.cast-subpage .application-modal.is-open .application-modal-panel {
    animation: smaisNativeSheetIn 0.24s cubic-bezier(.22,.85,.32,1) both;
  }

  @keyframes smaisNativeSheetIn {
    from { transform: translateY(24px); opacity: 0.65; }
    to { transform: translateY(0); opacity: 1; }
  }
}

/* Dashboard: turn the card website into an app home screen -------------- */
@media (max-width: 900px) {
  body.dashboard-page:not(.cast-subpage) {
    min-height: 100dvh;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-hero {
    position: sticky;
    top: 0;
    z-index: 2147481000;
    min-height: calc(58px + env(safe-area-inset-top, 0px));
    padding:
      calc(env(safe-area-inset-top, 0px) + 7px)
      62px
      7px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 10, 13, 0.82);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.20);
    -webkit-backdrop-filter: blur(24px) saturate(1.25);
    backdrop-filter: blur(24px) saturate(1.25);
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-hero-inner {
    min-height: 44px !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-center-image-wrap {
    min-height: 40px !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-center-image {
    width: 106px !important;
    max-height: 36px;
    object-fit: contain;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-notice-bell,
  body.dashboard-page:not(.cast-subpage) .dashboard-guide-menu {
    top: calc(env(safe-area-inset-top, 0px) + 9px) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-content {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 12px 14px !important;
    gap: 12px !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-section {
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid var(--smais-app-line) !important;
    border-radius: 20px !important;
    background: var(--smais-app-surface) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-mobile-tabbar,
  body.dashboard-page > .dashboard-mobile-tabbar.is-dashboard-floating-tabbar {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    z-index: 2147482600 !important;
    width: auto !important;
    min-height: 66px !important;
    margin: 0 !important;
    padding: 5px !important;
    transform: none !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 2px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 22px !important;
    background: rgba(17, 18, 22, 0.90) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.56) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.25) !important;
    backdrop-filter: blur(24px) saturate(1.25) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-mobile-tabbar button,
  body.dashboard-page > .dashboard-mobile-tabbar.is-dashboard-floating-tabbar button {
    min-width: 0 !important;
    min-height: 54px !important;
    padding: 4px 2px !important;
    border: 0 !important;
    border-radius: 17px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.50) !important;
    font-size: 10px !important;
    font-weight: 760 !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-mobile-tabbar button::before,
  body.dashboard-page > .dashboard-mobile-tabbar.is-dashboard-floating-tabbar button::before {
    width: 26px !important;
    height: 26px !important;
    margin: 0 auto 2px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font-size: 10px !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-mobile-tabbar button.is-active,
  body.dashboard-page > .dashboard-mobile-tabbar.is-dashboard-floating-tabbar button.is-active {
    color: #f8d98e !important;
    background: rgba(226, 189, 104, 0.11) !important;
    box-shadow: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-mobile-tabbar button.is-active::after,
  body.dashboard-page > .dashboard-mobile-tabbar.is-dashboard-floating-tabbar button.is-active::after {
    bottom: 2px !important;
    width: 18px !important;
    height: 2px !important;
    border-radius: 99px !important;
    background: var(--smais-app-accent) !important;
    box-shadow: 0 0 12px rgba(226, 189, 104, 0.55) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub {
    gap: 0 !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-card-group {
    overflow: hidden;
    border: 1px solid var(--smais-app-line) !important;
    border-radius: 18px !important;
    background: rgba(25, 26, 30, 0.74) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-card-group-head {
    padding: 18px 16px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card.is-mobile-primary,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon.is-mobile-primary {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) 18px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: 1px 12px !important;
    width: 100% !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card:last-child,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button:last-child {
    border-bottom: 0 !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card::before {
    display: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card::after,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button::after {
    content: "" !important;
    position: static !important;
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    justify-self: center !important;
    width: 8px !important;
    height: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    border-top: 1.7px solid rgba(255, 255, 255, 0.34) !important;
    border-right: 1.7px solid rgba(255, 255, 255, 0.34) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: rotate(45deg) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-icon {
    position: static !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.055) !important;
    object-fit: contain !important;
    filter: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    color: var(--smais-app-text) !important;
    font-size: 15px !important;
    font-weight: 790 !important;
    line-height: 1.35 !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-sub {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    margin: 2px 0 0 !important;
    overflow: hidden;
    color: var(--smais-app-muted) !important;
    font-size: 11.5px !important;
    line-height: 1.4 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-footer {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-logout {
    min-height: 42px;
    padding: 0 14px !important;
    border-radius: 13px !important;
    font-size: 12px !important;
  }
}

/* Authentication screens: remove the "web form floating in a page" feel. */
@media (max-width: 640px) {
  body.app-page {
    min-height: 100dvh;
    padding:
      calc(20px + env(safe-area-inset-top, 0px))
      12px
      calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--smais-app-bg) !important;
  }

  body.app-page > .card,
  body.app-page .card {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    padding: 22px 18px !important;
    border: 1px solid var(--smais-app-line) !important;
    border-radius: 22px !important;
    background: var(--smais-app-surface) !important;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36) !important;
  }

  body.app-page .card::before {
    display: none !important;
  }
}

/* Standalone PWA receives slightly stronger chrome and less browser-like spacing. */
html.smais-standalone body {
  min-height: 100dvh;
}


@media (prefers-reduced-motion: reduce) {
  html.smais-native-ui *,
  html.smais-native-ui *::before,
  html.smais-native-ui *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Dashboard surface correction -----------------------------------------
 * Keep one visible surface per component. The shared dashboard-section
 * treatment previously wrapped the profile face and operation list in
 * another card, which caused the double/triple-card appearance.
 */
@media (max-width: 900px) {
  body.dashboard-page:not(.cast-subpage) .dashboard-profile-flip-card {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-hub-section {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-hub-section::before,
  body.dashboard-page:not(.cast-subpage) .dashboard-hub-section::after {
    content: none !important;
    display: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub {
    margin: 0 !important;
    padding: 0 !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-card-group {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 18px !important;
    background: rgba(22, 23, 27, 0.90) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-card-group::before,
  body.dashboard-page:not(.cast-subpage) .dashboard-card-group::after {
    content: none !important;
    display: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-card-group-head {
    margin: 0 !important;
    padding: 14px 15px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card.is-mobile-primary,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon.is-mobile-primary {
    grid-column: auto !important;
    min-height: 70px !important;
    padding: 10px 13px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card:last-child,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button:last-child {
    border-bottom: 0 !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card::before,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button::before {
    content: none !important;
    display: none !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-icon,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card.is-mobile-primary .dashboard-card-icon,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon.is-mobile-primary .dashboard-card-icon {
    position: static !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 0.96 !important;
    transform: none !important;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.30)) !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card.is-mobile-primary .dashboard-card-title,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon.is-mobile-primary .dashboard-card-title {
    max-width: none !important;
    font-size: 15px !important;
  }

  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card.is-mobile-primary .dashboard-card-sub,
  body.dashboard-page:not(.cast-subpage) .dashboard-grid.dashboard-mobile-hub .dashboard-card-button.dashboard-card-with-icon.is-mobile-primary .dashboard-card-sub {
    display: block !important;
    max-width: none !important;
    margin: 2px 0 0 !important;
    overflow: hidden !important;
    color: var(--smais-app-muted) !important;
    font-size: 11.5px !important;
    line-height: 1.4 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    -webkit-line-clamp: unset !important;
  }
}

/* Guide pages: keep the mobile hero below the status-bar guard. */
@media (max-width: 760px) {
  body.smais-offset-statusbar.cast-subpage.guide-page > .guide-page-shell {
    padding-top: calc(var(--smais-statusbar-height, env(safe-area-inset-top, 0px)) + 16px) !important;
  }
}
