/* ──────────────────────────────────────────────────────────────────────────
   MYAH — phone layout (loaded by every page).
   Pages are styled inline for desktop; these rules give them room to breathe
   on small screens: a compact top bar, wider content, lighter card padding,
   readable headings and single-column rows.
   ────────────────────────────────────────────────────────────────────────── */

html, body { overflow-x: clip; }

/* ── Brand typography (every page) ────────────────────────────────────────
   Montserrat: 400 / 500 / 600 only. Lato: 700 is allowed for labels.
   Marcellus has a single weight: never let the browser fake a bold.     */
[style*="font-weight:700"]:not([style*="Lato"]),
[style*="font-weight: 700"]:not([style*="Lato"]),
[style*="font-weight:800"], [style*="font-weight:bold"] { font-weight: 600 !important; }
strong, b { font-weight: 600; }
h1, h2, h3, h4, [style*="Marcellus"] { font-weight: 400; }
[style*="Marcellus"] { font-weight: 400 !important; }

img, video { max-width: 100%; }

@media (max-width: 640px) {

  /* ── App top bar: logo + links on one tidy row ─────────────────────────── */
  [data-topnav] {
    padding: 10px 16px !important;
    gap: 6px 14px !important;
    flex-wrap: wrap !important;
  }
  [data-topnav] > a:first-child { gap: 10px !important; margin-left: 0 !important; }
  [data-topnav] > a:first-child img { height: 34px !important; width: 34px !important; }
  [data-topnav] > a:first-child > span { padding-left: 10px !important; gap: 4px !important; }
  [data-topnav] > a:first-child > span > span:first-child { font-size: 1.05rem !important; letter-spacing: .24em !important; }
  /* Keep "Make Yourself At Home" under the logo, on one line */
  [data-topnav] > a:first-child > span > span + span { display: block !important; font-size: .44rem !important; letter-spacing: .16em !important; white-space: nowrap !important; }
  [data-topnav] > div {
    flex: 1 1 auto; min-width: 0;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  [data-topnav] > div::-webkit-scrollbar { display: none; }
  [data-topnav] > div > a, [data-topnav] > div > button { white-space: nowrap !important; font-size: .7rem !important; letter-spacing: .1em !important; }
  /* Dashboards have several account links: give them their own scrolling row */
  [data-topnav] [data-acct-links] {
    flex-basis: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    row-gap: 8px !important;
    padding: 4px 0 2px !important;
    gap: 18px !important;
  }

  /* Public header (Browse, Sit pages) */
  [data-topbar] { padding: 10px 16px !important; gap: 12px !important; }
  [data-topbar] > a:first-child img { height: 36px !important; width: 36px !important; }
  [data-topbar] > a:first-child { gap: 10px !important; }
  [data-topbar] > a:first-child > span { padding-left: 10px !important; gap: 4px !important; }
  [data-topbar] > a:first-child > span > span:first-child { font-size: 1.1rem !important; letter-spacing: .24em !important; }
  [data-topbar] > a:first-child > span > span + span { display: block !important; font-size: .44rem !important; letter-spacing: .16em !important; white-space: nowrap !important; }

  /* ── Page gutters ──────────────────────────────────────────────────────── */
  [data-pad], [data-dash-pad], [data-page-pad] {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 26px !important;
  }

  /* ── Cards: lighter padding so text gets the width ─────────────────────── */
  [data-card],
  div[style*="padding:36px"], section[style*="padding:36px"],
  div[style*="padding:34px 36px"], section[style*="padding:34px 36px"],
  div[style*="padding:32px 34px"], section[style*="padding:32px 34px"],
  div[style*="padding:32px;"], section[style*="padding:32px;"],
  div[style*="padding:38px 40px"], div[style*="padding:44px 40px"] {
    padding: 22px 18px !important;
  }
  div[style*="padding:28px 26px"], div[style*="padding:26px 26px"], div[style*="padding:26px;"],
  div[style*="padding:28px;"], div[style*="padding:24px 26px"], div[style*="padding:22px 24px"],
  div[style*="padding:26px 28px"], div[style*="padding:24px 28px"] {
    padding: 18px 16px !important;
  }
  .db-card { padding: 22px 18px !important; }

  /* ── Headings ──────────────────────────────────────────────────────────── */
  h1[style*="font-size:2.5rem"], h1[style*="font-size:2.4rem"], h1[style*="font-size:2.3rem"] {
    font-size: 1.85rem !important; line-height: 1.2 !important;
  }
  h2[style*="font-size:2.5rem"], h2[style*="font-size:2.4rem"] { font-size: 1.8rem !important; }
  h2[style*="font-size:1.7rem"], h2[style*="font-size:1.6rem"] { font-size: 1.4rem !important; }
  h1[style*="font-size:2.9rem"], h1[style*="font-size:3rem"], h1[style*="font-size:2.8rem"],
  h2[style*="font-size:3rem"], h2[style*="font-size:2.9rem"], h2[style*="font-size:2.8rem"] {
    font-size: 2.15rem !important; line-height: 1.15 !important;
  }
  p[style*="font-size:3.4rem"] { font-size: 2.6rem !important; }

  /* ── Rows that are side by side on desktop stack on phones ─────────────── */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr)"],
  [style*="grid-template-columns:repeat(2,minmax(0,1fr))"]:not([data-keep-cols]),
  [style*="grid-template-columns:.7fr 1.6fr"],
  [style*="grid-template-columns:1fr 1.4fr"],
  [style*="grid-template-columns:minmax(0,1fr) minmax(0,.85fr)"],
  [style*="grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)"],
  [data-prev-revs] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  [style*="grid-template-columns:minmax(0,1fr) minmax(0,.85fr)"] { gap: 18px !important; }

  /* Browse filters: search on its own row, then two per row */
  [style*="grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  [style*="grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)"] > :first-child { grid-column: 1 / -1; }
  footer [style*="grid-template-columns"] { gap: 32px !important; padding: 44px 0 30px !important; }
  footer { padding-left: 20px !important; padding-right: 20px !important; }

  /* ── Big buttons: a touch smaller so labels fit ────────────────────────── */
  [style*="padding:16px 36px"] { padding: 14px 26px !important; }


  [data-amenities] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 8px !important; }

  /* Fixed save bars */
  [data-save-bar], [data-savebar] { padding: 12px 16px !important; }
}

/* Signed-in header on phones: the account links live behind a menu button,
   so pages start with the logo row and the Dashboard/Sits/Messages/Profile tabs. */
[data-acct-toggle] { display: none; }
@media (max-width: 640px) {
  [data-topnav] { position: relative; flex-wrap: nowrap !important; }
  [data-acct-toggle] { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px; padding: 10px; margin-right: -8px; background: none; border: 0; cursor: pointer; }
  [data-acct-toggle] span { display: block; width: 22px; height: 2px; border-radius: 2px; background: #2c1a0e; transition: transform .2s, opacity .2s; }
  .acct-open [data-acct-toggle] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .acct-open [data-acct-toggle] span:nth-child(2) { opacity: 0; }
  .acct-open [data-acct-toggle] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  [data-topnav] [data-acct-links] { display: none !important; }
  [data-topnav].acct-open [data-acct-links] {
    display: flex !important; flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
    background: #fff; padding: 6px 16px 12px !important; gap: 0 !important;
    border-bottom: 1px solid rgba(110,84,56,.2); box-shadow: 0 14px 30px rgba(44,26,14,.12);
  }
  [data-topnav].acct-open [data-acct-links] > a { padding: 13px 2px !important; font-size: .8rem !important; border-bottom: 1px solid rgba(44,26,14,.07) !important; }
  [data-topnav].acct-open [data-acct-links] > a:last-child { border-bottom: 0 !important; }
}

/* Two choices side by side even on phones (e.g. Solo sitter / Joint couple). */
@media (max-width: 960px) { [data-keep-two] { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 10px !important; } }

/* Profile type choice (Solo sitter / Joint couple) on Create and Edit profile. */
.tc-card { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 44px 18px 18px; text-align: left; font-family: 'Montserrat', sans-serif; color: #2c1a0e; background: #fff; border: 1.5px solid rgba(44,26,14,.14); border-radius: 16px; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .15s, background .2s; }
.tc-card:hover { border-color: #2f5d45; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(44,26,14,.08); }
.tc-card:focus-visible { outline: 2px solid rgba(47,93,69,.45); outline-offset: 2px; }
.tc-card.on { border-color: #2f5d45; background: linear-gradient(180deg, #f2f7f3 0%, #fff 100%); box-shadow: 0 0 0 3px rgba(47,93,69,.12); }
.tc-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f3ece0; color: #6e5438; transition: background .2s, color .2s; }
.tc-card.on .tc-icon { background: #2f5d45; color: #fff; }
.tc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tc-title { font-family: 'Marcellus', serif; font-size: 1.15rem; line-height: 1.2; color: #2c1a0e; }
.tc-sub { font-size: .78rem; color: #6b4e35; }
.tc-tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(44,26,14,.22); display: flex; align-items: center; justify-content: center; color: transparent; background: #fff; transition: background .2s, border-color .2s, color .2s; }
.tc-card.on .tc-tick { background: #2f5d45; border-color: #2f5d45; color: #fff; }
@media (max-width: 640px) {
  .tc-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 14px 16px; }
  .tc-icon { width: 40px; height: 40px; }
  .tc-title { font-size: 1.05rem; }
}
