/* CAISSA Mobile Experience — Season 001. Desktop Home is intentionally untouched. */
.mobile-shell,
.mobile-skip,
.mobile-sheet {
  display: none;
}

@media (max-width: 720px) {
  :root {
    --mobile-ink: #151a24;
    --mobile-muted: #5c6575;
    --mobile-blue: #087bd5;
    --mobile-blue-deep: #064c96;
    --mobile-surface: rgba(255, 255, 255, 0.96);
    --mobile-line: rgba(28, 42, 64, 0.1);
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  html {
    color-scheme: light;
    background: #e8ebf0;
    scroll-padding-top: calc(78px + var(--mobile-safe-top));
  }

  body {
    min-width: 0;
    min-height: 100dvh;
    overflow-x: clip;
    background: #e8ebf0;
    color: var(--mobile-ink);
  }

  .desktop-skip,
  .sidebar,
  .shell,
  .mobile-nav,
  #home-settings {
    display: none !important;
  }

  .mobile-skip {
    position: fixed;
    z-index: 100;
    top: -90px;
    left: 16px;
    display: block;
    min-height: 44px;
    padding: 11px 16px;
    border-radius: 10px;
    background: #fff;
    color: #10233d;
    font-weight: 750;
    box-shadow: 0 10px 30px #0610203d;
  }

  .mobile-skip:focus {
    top: calc(12px + var(--mobile-safe-top));
  }

  .mobile-shell {
    display: block;
    min-width: 0;
    min-height: 100dvh;
    padding-bottom: var(--mobile-safe-bottom);
    background:
      linear-gradient(180deg, #f7f8fa 0 7%, transparent 7%),
      linear-gradient(180deg, #c8ced8 24%, #eef0f4 62%, #dfe3e9 100%);
  }

  .mobile-header {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    min-height: calc(76px + var(--mobile-safe-top));
    padding: calc(9px + var(--mobile-safe-top)) 18px 9px;
    border-bottom: 1px solid rgba(16, 29, 48, 0.08);
    background: rgba(250, 251, 253, 0.94);
    backdrop-filter: blur(18px) saturate(1.15);
  }

  .mobile-header-brand {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .mobile-header-brand img {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    object-fit: cover;
  }

  .mobile-header-title {
    color: #262c37;
    text-align: center;
    font-size: clamp(21px, 5.8vw, 25px);
    line-height: 1.1;
    letter-spacing: -0.04em;
    white-space: nowrap;
  }

  .mobile-header-title strong {
    font-weight: 800;
    letter-spacing: 0.01em;
  }

  .mobile-hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(274px, 74vw, 326px);
    overflow: hidden;
    isolation: isolate;
    background:
      radial-gradient(circle at 50% 58%, rgba(22, 133, 238, 0.34), transparent 35%),
      linear-gradient(145deg, #090e16 0%, #121a27 52%, #344052 100%);
  }

  .mobile-hero::after {
    position: absolute;
    z-index: -1;
    right: -20%;
    bottom: -45%;
    left: -20%;
    height: 72%;
    content: "";
    background: radial-gradient(ellipse, rgba(123, 177, 233, 0.35), transparent 67%);
    filter: blur(18px);
  }

  .mobile-hero-halo {
    position: absolute;
    z-index: -1;
    width: min(72vw, 310px);
    aspect-ratio: 1;
    border: 1px solid rgba(46, 155, 255, 0.23);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(5, 117, 222, 0.44), rgba(4, 60, 126, 0.18) 58%, transparent 70%);
    box-shadow: 0 0 70px rgba(0, 125, 255, 0.25);
  }

  .mobile-hero img {
    width: min(68vw, 300px);
    height: auto;
    object-fit: contain;
    filter: saturate(1.12) contrast(1.05) drop-shadow(0 17px 22px rgba(0, 81, 176, 0.38));
    mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 43%, rgba(0, 0, 0, 0.92) 60%, transparent 78%);
    mask-image: radial-gradient(ellipse at center, #000 43%, rgba(0, 0, 0, 0.92) 60%, transparent 78%);
  }

  .mobile-home-main {
    min-width: 0;
    max-width: 540px;
    margin: 0 auto;
    padding: 18px 16px calc(28px + var(--mobile-safe-bottom));
    outline: none;
  }

  .mobile-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .mobile-card-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
  }

  .mobile-card {
    width: 100%;
    min-width: 0;
    min-height: 92px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 23px;
    background: var(--mobile-surface);
    color: var(--mobile-ink);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.92) inset,
      0 10px 24px rgba(24, 35, 52, 0.09);
  }

  a.mobile-card,
  button.mobile-card,
  .mobile-card-summary {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    text-align: left;
  }

  button.mobile-card {
    appearance: none;
    font: inherit;
    cursor: pointer;
  }

  .mobile-card:active {
    transform: scale(0.992);
  }

  .mobile-card:focus-visible,
  .mobile-card a:focus-visible,
  .mobile-settings-list button:focus-visible,
  .mobile-sheet button:focus-visible,
  .mobile-sheet a:focus-visible,
  .mobile-sheet select:focus-visible {
    outline: 3px solid #0b8ce4;
    outline-offset: 3px;
  }

  .mobile-card-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-right: 1px solid var(--mobile-line);
    color: #273241;
    font-size: 28px;
  }

  .mobile-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-card-copy strong {
    color: #0d1118;
    font-size: clamp(19px, 5vw, 22px);
    line-height: 1.2;
    letter-spacing: -0.025em;
  }

  .mobile-card-copy small {
    color: #444d5d;
    font-size: clamp(13px, 3.55vw, 15px);
    line-height: 1.35;
  }

  .mobile-card-chevron {
    color: #8a94a3;
    font-size: 14px;
    transition: transform 160ms ease;
  }

  .mobile-submenu {
    overflow: clip;
  }

  .mobile-card-summary {
    min-height: 90px;
    cursor: pointer;
    list-style: none;
  }

  .mobile-card-summary::-webkit-details-marker {
    display: none;
  }

  .mobile-submenu[open] .mobile-card-summary .mobile-card-chevron {
    transform: rotate(180deg);
  }

  .mobile-submenu-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 0 15px 15px;
  }

  .mobile-submenu-options a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: 9px 10px;
    border: 1px solid #d3d8e0;
    border-radius: 15px;
    background: #f8fafc;
    color: #161c25;
  }

  .mobile-submenu-options a:first-child {
    border-color: #159ee9;
    box-shadow: 0 0 0 1px #159ee9 inset;
  }

  .mobile-submenu-options a > i {
    color: var(--mobile-blue);
    text-align: center;
    font-size: 20px;
  }

  .mobile-submenu-options a span {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .mobile-submenu-options strong {
    font-size: 15px;
    line-height: 1.2;
  }

  .mobile-submenu-options small {
    color: var(--mobile-muted);
    font-size: 10px;
    line-height: 1.25;
  }

  .mobile-home-signoff {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
    color: #667080;
    font-size: 12px;
    letter-spacing: 0.05em;
  }

  dialog.mobile-sheet {
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    width: min(100%, 540px);
    max-width: none;
    max-height: min(88dvh, 760px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 28px 28px 0 0;
    background: #f7f8fa;
    color: var(--mobile-ink);
    box-shadow: 0 -18px 60px rgba(7, 15, 28, 0.3);
  }

  dialog.mobile-sheet[open] {
    display: block;
  }

  .mobile-sheet::backdrop {
    background: rgba(5, 11, 19, 0.55);
    backdrop-filter: blur(4px);
  }

  .mobile-sheet-card {
    max-height: min(88dvh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: var(--mobile-safe-bottom);
  }

  .mobile-sheet-header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    min-height: 80px;
    padding: 13px 16px;
    border-bottom: 1px solid #dfe3e9;
    background: rgba(247, 248, 250, 0.95);
    backdrop-filter: blur(16px);
  }

  .mobile-sheet-header > div {
    min-width: 0;
    text-align: center;
  }

  .mobile-sheet-header p {
    color: #6f7988;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.17em;
  }

  .mobile-sheet-header h2 {
    color: #121721;
    font-size: 22px;
  }

  .mobile-sheet-back,
  .mobile-sheet-close {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 50%;
    background: #e8ebf0;
    color: #253144;
    cursor: pointer;
  }

  .mobile-sheet-back[hidden] {
    visibility: hidden;
    display: grid !important;
  }

  .mobile-settings-list {
    display: grid;
    gap: 1px;
    padding: 10px 16px 22px;
  }

  .mobile-settings-list[hidden] {
    display: none;
  }

  .mobile-settings-list button {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 10px 6px;
    border: 0;
    border-bottom: 1px solid #e0e4ea;
    background: transparent;
    color: #19212d;
    text-align: left;
    cursor: pointer;
  }

  .mobile-settings-list button > i:first-child {
    color: var(--mobile-blue);
    text-align: center;
    font-size: 20px;
  }

  .mobile-settings-list button > i:last-child {
    color: #929ba8;
    text-align: center;
    font-size: 12px;
  }

  .mobile-settings-list span {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .mobile-settings-list strong {
    font-size: 16px;
  }

  .mobile-settings-list small {
    color: #6c7583;
    font-size: 12px;
  }

  .mobile-settings-panels {
    padding: 22px 20px 32px;
  }

  .mobile-settings-panels section {
    min-height: 190px;
  }

  .mobile-settings-panels h3 {
    color: #101620;
    font-size: 25px;
    letter-spacing: -0.03em;
  }

  .mobile-settings-panels p {
    margin: 8px 0 18px;
    color: #596474;
    font-size: 15px;
  }

  .mobile-settings-panels a,
  .mobile-settings-panels select {
    align-items: center;
    min-height: 48px;
    width: 100%;
    border: 1px solid #cdd3dd;
    border-radius: 13px;
    background: #fff;
    color: #152033;
    padding: 10px 14px;
    font: inherit;
  }

  .mobile-settings-panels a {
    display: flex;
    justify-content: center;
    color: #075da7;
    font-weight: 750;
  }

  .mobile-settings-panels label {
    display: block;
    margin-bottom: 7px;
    color: #4c5665;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-settings-panels select {
    display: block;
    font-size: 16px;
    touch-action: manipulation;
    -webkit-appearance: menulist;
    appearance: auto;
  }

  @media (max-width: 380px) {
    .mobile-header {
      padding-inline: 12px;
    }

    .mobile-home-main {
      padding-inline: 12px;
    }

    a.mobile-card,
    button.mobile-card,
    .mobile-card-summary {
      grid-template-columns: 52px minmax(0, 1fr) 16px;
      gap: 9px;
      padding-inline: 13px;
    }

    .mobile-card-icon {
      width: 52px;
      height: 54px;
      font-size: 25px;
    }

    .mobile-submenu-options {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .mobile-card,
  .mobile-card-chevron {
    transition: none;
  }
}
