/* The touch-capable range includes large landscape tablets with a trackpad. */
@media (min-width: 600px) and (max-width: 1100px),
       (min-width: 600px) and (max-width: 1440px) and (orientation: portrait),
       (min-width: 600px) and (max-width: 1440px) and (any-pointer: coarse) {
  .care-shell-page {
    --tablet-gutter: clamp(22px, 3.8vw, 48px);
    --tablet-content: 1160px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top, 0px) 0 0;
    overflow: clip;
    background: #f7f5f4;
  }
  .care-shell-page .desktop-note, .care-shell-page .desktop-footer { display: none; }
  .care-shell-page .phone-shell {
    display: grid;
    flex: 1 1 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .care-shell-page .app-header {
    grid-area: 1 / 1;
    min-width: 0;
    height: auto;
    min-height: 72px;
    padding-block: 10px;
    padding-inline: max(var(--tablet-gutter), env(safe-area-inset-left, 0px))
      max(var(--tablet-gutter), env(safe-area-inset-right, 0px));
  }
  .care-shell-page .app-header::after,
  .care-shell-page .tabbar::before,
  .care-shell-page .tabbar::after { content: none; }
  .care-shell-page .brand { font-size: 22px; }
  .care-shell-page .brand small { font-size: 12px; }
  .care-shell-page .text-size { min-height: 48px; }
  .care-shell-page #app {
    grid-area: 2 / 1;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
  }
  .care-shell-page .tabbar {
    grid-area: 3 / 1;
    position: static;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 150px));
    justify-content: center;
    align-items: center;
    gap: clamp(5px, 1.5vw, 17px);
    width: 100%;
    height: auto;
    padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px));
    padding-inline: max(16px, env(safe-area-inset-left, 0px))
      max(16px, env(safe-area-inset-right, 0px));
    border-top: 1px solid var(--line);
    border-right: 0;
  }
  .care-shell-page .tabbar > :is(a, button) {
    height: 54px;
    min-height: 54px;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 16px;
    border-radius: 13px;
  }
  .care-shell-page .tabbar .ai-tab { gap: 7px; padding: 6px 8px; }
  .care-shell-page .tabbar .ai-orb { flex: 0 0 38px; width: 38px; height: 38px; }
  .care-shell-page .tabbar .ai-orb img { width: 34px; height: 46px; transform: none; }
  .care-shell-page .tabbar [aria-current="page"] { background: #f9ebed; color: var(--red); }
  .care-shell-page .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }

  .care-shell-page .watch-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }
  .care-shell-page .video-feed { grid-area: 1 / 1; min-width: 0; min-height: 0; }
  .care-shell-page .watch-sidebar { display: none; }
  .care-shell-page .video-card,
  .care-shell-page.large .video-card { min-height: 100%; }
  .care-shell-page .inline-video {
    --watch-inset: var(--tablet-gutter);
    --watch-rail: 110px;
  }
  .care-shell-page .inline-video .video-actions button { min-height: 54px; width: 58px; }
  .care-shell-page .inline-video .video-bottom button { min-height: 48px; }

  .care-shell-page .view-heading { padding: 26px var(--tablet-gutter) 20px; }
  .care-shell-page .view-heading h1 { font-size: 32px; overflow-wrap: anywhere; }
  .care-shell-page .filters { padding-inline: var(--tablet-gutter); }
  .care-shell-page .filters button { min-height: 48px; }
  .care-shell-page .masonry {
    max-width: var(--tablet-content);
    margin-inline: auto;
    columns: 2;
    column-gap: 20px;
    padding: 22px var(--tablet-gutter);
  }
  .care-shell-page.large .masonry { max-width: 760px; columns: 1; }
  .care-shell-page .read-card,
  .care-shell-page .read-card-body { min-width: 0; }
  .care-shell-page .read-card h2 { overflow-wrap: anywhere; }
  .care-shell-page .masonry .read-card .cover-wrap {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .care-shell-page .quote-cover { min-height: 210px; }

  .care-shell-page .hub-return {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    padding-inline: var(--tablet-gutter);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }
  .care-shell-page .hub-return a,
  .care-shell-page .account-link { display: inline-flex; align-items: center; min-height: 44px; }
  .care-shell-page .discover-hero {
    height: clamp(188px, 25vw, 280px);
    margin: 22px var(--tablet-gutter);
  }
  .care-shell-page .service-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-inline: var(--tablet-gutter);
  }
  .care-shell-page .service-card { min-width: 0; }
  .care-shell-page .help-band, .care-shell-page .emergency { margin-inline: var(--tablet-gutter); }
  .care-shell-page .human-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 22px var(--tablet-gutter);
  }
  .care-shell-page :is(.human-card, .steps) { min-width: 0; margin: 0; }
  .care-shell-page #filters.live-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 22px var(--tablet-gutter);
    border-radius: 16px;
  }
  .care-shell-page #filters button { grid-column: 1 / -1; min-height: 48px; }
  .care-shell-page .institution-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0 var(--tablet-gutter) 18px;
  }
  .care-shell-page .institution-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdfc;
  }
  .care-shell-page .institution-card h2 { overflow-wrap: anywhere; }
  .care-shell-page .institution-card p { margin-block: 8px; overflow-wrap: anywhere; }
  .care-shell-page .institution-code, .care-shell-page .institution-price { color: var(--red); }
  .care-shell-page .institution-price small { display: block; color: var(--muted); }
  .care-shell-page .institution-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px 4px; }
  .care-shell-page .institution-actions button { min-height: 48px; }
  .care-shell-page .compare-box { margin-inline: var(--tablet-gutter); }
  .care-shell-page .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .care-shell-page .detail-dialog { width: min(660px, calc(100% - 44px)); }
}

@media (min-width: 740px) and (max-width: 1100px),
       (min-width: 740px) and (max-width: 1440px) and (orientation: portrait),
       (min-width: 740px) and (max-width: 1440px) and (any-pointer: coarse) {
  .care-shell-page .human-layout { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .care-shell-page .service-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .care-shell-page .service-card {
    display: block;
    position: relative;
    min-height: 166px;
    padding: 18px;
  }
  .care-shell-page .service-card .service-icon { margin-bottom: 14px; }
  .care-shell-page .service-card .chevron { position: absolute; right: 18px; top: 22px; }
}

@media (min-width: 990px) and (max-width: 1100px) and (orientation: landscape) and (min-height: 590px),
       (min-width: 990px) and (max-width: 1440px) and (orientation: landscape) and (min-height: 590px) and (any-pointer: coarse) {
  .care-shell-page .watch-view { grid-template-columns: minmax(0, 1fr) clamp(252px, 27vw, 340px); }
  .care-shell-page .watch-sidebar { display: block; min-width: 0; padding: 24px 22px; }
  .care-shell-page .masonry { columns: 3; }
  .care-shell-page.large .masonry { columns: 1; }
  .care-shell-page .compare-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
