/* ===========================================================================
   HomeSearchIQ app shell — css/app.css
   Self-contained chrome for the installable PWA (app.html). Uses the brand
   tokens from the design system but does NOT depend on the heavy css/styles.css,
   so the shell stays light and can't be disturbed by global page rules.
   =========================================================================== */
@import url('https://fonts.bunny.net/css2?family=Montserrat:wght@400;600;700;800;900&family=Open+Sans:wght@400;500;600&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --navy: #1B3A5C;
  --navy-dark: #122840;
  --navy-light: #254d7a;
  --gold: #C9A455;
  --gold-light: #dbbf76;
  --teal: #2089A0;
  --cream: #F6F3EC;
  --surface: #FFFFFF;
  --surface-2: #F1EEE6;
  --line: #E4DFD4;
  --ink: #1a2634;
  --ink-soft: #5b6675;
  --good: #2f8f5b;
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --tabbar-h: 62px;
  --shadow-card: 0 8px 24px -16px rgba(18,40,64,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #d9d4c8;            /* backdrop behind the app column on wide screens */
  -webkit-text-size-adjust: 100%;
}

/* The app is a centered phone-width column on desktop, full-bleed on mobile. */
.app {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px -20px rgba(0,0,0,.5);
}

/* ---- top bar ---- */
.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
}
.app-top__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-brand__mark { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: block; }
.app-brand__name { font: 800 17px/1 var(--font-head); letter-spacing: .01em; }
.app-brand__name b { color: var(--gold); font-weight: 800; }
.app-top__act { display: flex; gap: 6px; }
.app-top__btn {
  background: rgba(255,255,255,.1); border: 0; color: #fff; cursor: pointer;
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
}
.app-search {
  margin-top: 12px; display: flex; align-items: center; gap: 9px;
  background: #fff; border-radius: 12px; padding: 11px 13px; color: var(--ink);
}
.app-search svg { color: var(--navy); flex: 0 0 auto; }
.app-search input {
  border: 0; outline: 0; font: 500 15px var(--font-body); color: var(--ink);
  width: 100%; background: transparent;
}
.app-tagline { margin: 10px 0 0; font: 500 12.5px var(--font-body); color: rgba(255,255,255,.8); }

/* ---- content panes ---- */
.app-body { flex: 1 1 auto; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
.pane { display: none; padding: 16px 16px 24px; }
.pane.is-active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.sect-eyebrow {
  font: 700 11px var(--font-head); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin: 2px 0 6px;
}
.sect-title { font: 700 20px/1.15 var(--font-head); color: var(--ink); margin: 0 0 4px; }
.sect-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.5; }

/* quick actions */
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.quick-btn {
  text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 13px; display: flex;
  flex-direction: column; gap: 3px; box-shadow: var(--shadow-card);
}
.quick-btn__ico { font-size: 20px; }
.quick-btn__lbl { font: 700 13.5px var(--font-head); }
.quick-btn__sub { font-size: 11.5px; color: var(--ink-soft); }

/* quick filter builder */
.filter-card {
  background: var(--navy); color: #fff; border-radius: 16px; padding: 15px; margin-bottom: 20px;
}
.filter-card__t { font: 700 14px var(--font-head); margin: 0 0 11px; display: flex; align-items: center; gap: 7px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.filter-chips[data-group] { }
.fchip {
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff;
  border-radius: 999px; padding: 7px 13px; font: 600 12.5px var(--font-body); cursor: pointer;
}
.fchip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--navy-dark); }
.filter-card__go {
  width: 100%; border: 0; border-radius: 11px; background: var(--gold); color: var(--navy-dark);
  font: 700 14px var(--font-head); padding: 12px; cursor: pointer; margin-top: 2px;
}
.filter-card__lbl { font: 600 11px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gold-light); margin: 0 0 6px; }

/* neighborhood clusters */
.city-group { margin-bottom: 18px; }
.city-group__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.city-group__name { font: 700 15px var(--font-head); color: var(--ink); }
.city-group__all { font: 600 12px var(--font-head); color: var(--navy); text-decoration: none; }
.hood-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.hood-card {
  text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 3px;
}
.hood-card__name { font: 700 13px var(--font-head); color: var(--ink); }
.hood-card__tag { font-size: 11px; color: var(--ink-soft); }

/* generic feature cards (saved / tools / profile) */
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; text-align: center; box-shadow: var(--shadow-card); margin-bottom: 14px;
}
.feature__ico {
  width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--navy);
}
.feature h3 { font: 700 17px var(--font-head); margin: 0 0 6px; color: var(--ink); }
.feature p { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 14px; }
.btn {
  display: inline-block; text-decoration: none; text-align: center; border: 0; cursor: pointer;
  border-radius: 11px; font: 700 14px var(--font-head); padding: 12px 18px; width: 100%;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--gold { background: var(--gold); color: var(--navy-dark); }
.btn--ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn + .btn { margin-top: 9px; }

.tool-list { display: flex; flex-direction: column; gap: 10px; }
.tool-row {
  display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
}
.tool-row__ico { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2); color: var(--navy); display: grid; place-items: center; flex: 0 0 auto; font-size: 20px; }
.tool-row__body { min-width: 0; flex: 1; }
.tool-row__t { font: 700 14px var(--font-head); }
.tool-row__s { font-size: 12px; color: var(--ink-soft); }
.tool-row__arrow { color: var(--gold); font-weight: 700; }

.install-tip {
  background: var(--surface-2); border: 1px dashed var(--gold); border-radius: 12px;
  padding: 11px 13px; font-size: 12.5px; color: var(--ink); margin-bottom: 16px; line-height: 1.5;
  display: none;
}
.install-tip.is-shown { display: block; }
.install-tip b { font-family: var(--font-head); }

.app-note {
  font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; text-align: center;
  padding: 4px 6px 0;
}

/* ---- bottom tab bar ---- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 40;
  width: 100%; max-width: 520px;
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbtn {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-soft); font: 700 10px var(--font-head); letter-spacing: .02em; padding: 2px;
}
.tabbtn svg { width: 22px; height: 22px; }
.tabbtn[aria-selected="true"] { color: var(--navy); }
.tabbtn[aria-selected="true"] svg { color: var(--gold); }

/* IDX widgets injected into the app get a little breathing room */
.idx-slot { margin-bottom: 18px; min-height: 40px; }

/* IDXAddons Omnisearch — reshape the injected widget to fit the app column.
   Structure: #idxaddons-omnisearch-form > .selectContainer (label + input) ×5 + button. */
.idx-omni { margin-bottom: 18px; }
.idx-omni * { box-sizing: border-box; max-width: 100%; }
.idx-omni #idxaddons-omnisearch-form,
.idx-omni .idxaddons--search {
  display: flex !important; flex-wrap: wrap !important; gap: 10px !important; width: 100% !important;
}
.idx-omni .selectContainer {
  flex: 1 1 46% !important; min-width: 0 !important; margin: 0 !important;
  display: flex !important; flex-direction: column !important; gap: 5px !important;
}
.idx-omni #idxaddonsAcInputContainer { flex: 1 1 100% !important; }   /* search spans full width */
.idx-omni label {
  font: 600 11px var(--font-head) !important; letter-spacing: .04em !important;
  text-transform: uppercase !important; color: var(--ink-soft) !important; margin: 0 !important;
}
.idx-omni #iaofMinPrice, .idx-omni #iaofMaxPrice,
.idx-omni #iaofBeds, .idx-omni #iaofBaths,
.idx-omni .ms-ctn.form-control {
  background: #fff !important; border: 1px solid var(--line) !important; border-radius: 11px !important;
  padding: 11px 12px !important; font-size: 14px !important; color: var(--ink) !important;
  width: 100% !important; min-height: 44px; box-shadow: none !important;
}
.idx-omni .ms-ctn input { border: 0 !important; padding: 0 !important; background: transparent !important; }
.idx-omni #idxaddons-omnisearch-form button,
.idx-omni .idxaddons--search button {
  flex: 1 1 100% !important; order: 99; background: var(--gold) !important; color: var(--navy-dark) !important;
  border: 0 !important; border-radius: 11px !important; padding: 13px !important;
  font: 700 14px var(--font-head) !important; cursor: pointer;
}

@media (max-width: 380px) {
  .quick-row, .hood-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pane.is-active { animation: none; } }
