/* Shared phone and tablet refinements for Kai Home Care. */
.mobile-only,
.mobile-sticky {
  display: none;
}

@media (max-width: 1000px) {
  [data-stack] > * {
    min-width: 0;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  .mobile-header {
    position: sticky !important;
    top: 0;
    z-index: 100 !important;
    min-height: 78px !important;
    padding: 12px 20px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    background: #07141c !important;
  }

  .mobile-header > a:first-child {
    min-width: 0;
  }

  .mobile-header > a:first-child img {
    display: block;
    width: auto !important;
    height: 43px !important;
    max-width: 190px;
    object-fit: contain;
  }

  .mobile-tools {
    justify-self: end;
    align-items: center;
    gap: 8px;
  }

  .mobile-call,
  .mobile-menu > summary {
    min-width: 48px;
    min-height: 48px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(233, 221, 200, .48);
    color: #f7f3eb;
    background: rgba(255, 255, 255, .04);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  .mobile-menu {
    position: relative;
  }

  .mobile-menu > summary {
    cursor: pointer;
    list-style: none;
  }

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

  .mobile-menu[open] > summary {
    color: #0b1d29;
    background: #e9ddc8;
  }

  .mobile-menu nav {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 120;
    width: min(294px, calc(100vw - 40px));
    padding: 8px;
    display: grid;
    background: #f7f3eb;
    color: #0b1d29;
    border: 1px solid #d8cfc1;
    box-shadow: 0 20px 50px rgba(4, 14, 20, .35);
  }

  .mobile-menu nav a {
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e3dcce;
    font-size: 14px;
  }

  .mobile-menu nav a:last-child {
    border-bottom: 0;
  }

  .mobile-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    gap: 1px;
    padding-bottom: env(safe-area-inset-bottom);
    background: #07141c;
    box-shadow: 0 -12px 34px rgba(5, 15, 21, .3);
  }

  .mobile-sticky > a,
  .mobile-sticky > button {
    flex: 1;
    min-width: 0;
    min-height: 60px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
  }

  .mobile-sticky .mobile-sticky-secondary {
    color: #f7f3eb;
    background: #0b1d29;
  }

  .mobile-sticky .mobile-sticky-primary {
    color: #fff;
    background: #7c9c91;
  }

  .mobile-safe-footer {
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-safe-footer a:not([aria-label]) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .mobile-form-card,
  .mobile-form-grid,
  .mobile-form-card form,
  .mobile-form-card label {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .mobile-form-card input:not([type="checkbox"]),
  .mobile-form-card select,
  .mobile-form-card textarea {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 16px !important;
  }

  .mobile-form-card input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    flex: none;
  }

  .mobile-form-card button[type="submit"] {
    width: 100%;
  }

  .site-footer {
    grid-template-columns: 1fr !important;
  }

  .mobile-photo {
    min-height: 240px;
  }
}

@media (max-width: 640px) {
  .mobile-header {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .mobile-header > a:first-child img {
    height: 38px !important;
    max-width: 170px;
  }

  .mobile-call {
    min-width: 46px;
    padding: 0 9px;
  }

  .mobile-menu > summary {
    min-width: 50px;
    padding: 0 9px;
  }

  .mobile-hero-copy {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }

  .mobile-hero-copy h1 {
    font-size: clamp(40px, 11.8vw, 54px) !important;
    line-height: .98 !important;
  }

  .mobile-hero-copy h2 {
    font-size: clamp(39px, 11vw, 50px) !important;
  }

  .mobile-hero-actions,
  .mobile-hero-actions > a,
  .mobile-hero-actions > button {
    width: 100%;
  }

  .mobile-hero-actions > a,
  .mobile-hero-actions > button {
    justify-content: center;
    text-align: center;
  }

  [data-tiles] {
    grid-template-columns: 1fr !important;
  }

  .mobile-time-blocks {
    grid-template-columns: 1fr 1fr !important;
  }

  .mobile-image-pair {
    grid-template-columns: 1fr !important;
  }

  .mobile-image-pair > div {
    height: 260px !important;
  }

  .mobile-form-card {
    padding: 24px 18px !important;
  }

  .mobile-form-grid {
    grid-template-columns: 1fr !important;
  }

  .mobile-form-card fieldset > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .mobile-form-card fieldset label {
    width: 100%;
  }

  .quiz-view,
  .schedule-view,
  .plan-wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .quiz-view h2,
  .schedule-view h2 {
    font-size: clamp(36px, 10vw, 42px) !important;
  }

  .quiz-view input:not([type="checkbox"]),
  .quiz-view select,
  .quiz-view textarea {
    max-width: 100% !important;
    font-size: 16px !important;
  }

  .mobile-progress-shell {
    position: sticky;
    top: 78px;
    z-index: 60;
    margin: -12px 0 34px;
    padding: 14px 0 16px;
    background: rgba(247, 243, 235, .97);
    backdrop-filter: blur(8px);
  }

  .mobile-progress-shell > div {
    margin-bottom: 0 !important;
  }

  .quiz-view section > div[style*="justify-content:space-between"] {
    gap: 12px !important;
  }

  .quiz-view section > div[style*="justify-content:space-between"] > button:last-child {
    min-width: 0 !important;
    flex: 1;
  }

  .schedule-picker > div > div:not(:first-child) {
    min-height: 52px;
    display: grid;
    place-content: center;
  }

  .plan-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .plan-actions button {
    width: 100%;
  }

  .doc-header {
    gap: 12px !important;
  }

  .doc-logo {
    max-width: 140px;
    height: auto !important;
  }

  .doc-meta {
    font-size: 9px !important;
  }
}
