/* Northbury HOA owner-face prototype */
:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --panel2: #232d3a;
  --ink: #e8eef5;
  --muted: #9aabbc;
  --accent: #3d9cf0;
  --accent2: #5ad4a8;
  --warn: #f0b429;
  --danger: #f07178;
  --up: #5ad4a8;
  --baseline: #3d9cf0;
  --peer: #c9a227;
  --border: #2e3a48;
  --radius: 12px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); }
.banner {
  background: linear-gradient(90deg, #5a3a00, #8a5a00);
  color: #fff8e6;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 40;
}
.banner span { opacity: 0.9; font-weight: 400; }
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.05rem; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.views { display: flex; flex-wrap: wrap; gap: 0.35rem; flex: 1; }
.views button {
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.views button:hover { border-color: var(--accent); }
.views button.active {
  background: var(--accent);
  color: #041018;
  border-color: var(--accent);
  font-weight: 600;
}
.shell {
  display: grid;
  grid-template-columns: 2fr 1fr; /* map = 2/3 */
  flex: 1;
  min-height: 0;
  height: 0; /* force flex child to fill remaining viewport */
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(55vh, 1fr) minmax(220px, 38vh); height: auto; flex: 1; }
}
.map-wrap {
  position: relative;
  background: #0a0e12;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
#gmap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.pin-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.pin-dot {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.55));
}
.pin-dot .bubble {
  display: inline-block;
  background: var(--panel);
  border: 2px solid var(--baseline);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--mono);
  white-space: nowrap;
}
.pin-dot.baseline .bubble { border-color: var(--baseline); background: #12324a; }
.pin-dot.up .bubble, .pin-dot.lower .bubble { border-color: var(--up); background: #123a2e; }
.pin-dot.peer-band .bubble { border-color: var(--peer); background: #3a3212; }
.pin-dot.open-safety .bubble { border-color: var(--danger); background: #3a1218; }
.pin-dot.never-opened-ask .bubble { border-color: var(--warn); background: #3a2e12; }
.pin-dot .stem { width: 2px; height: 10px; background: #9aabbc; margin: 0 auto; opacity: 0.7; }
.map-hint {
  position: absolute; left: 0.75rem; bottom: 0.75rem; z-index: 6;
  background: rgba(15,20,25,.85); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.65rem; font-size: 0.72rem;
  color: var(--muted); max-width: 58%;
}
.map-hint a { color: var(--accent2); }
.side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--panel);
}
.panel-scroll {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 0.9rem 0.5rem;
  min-height: 0;
}
.panel-scroll h2 { font-size: 1rem; }
.panel-scroll .lede { font-size: 0.82rem; margin-bottom: 0.55rem; }
.panel-scroll .card { padding: 0.55rem 0.7rem; margin-bottom: 0.4rem; }
.panel-scroll .card .meta { font-size: 0.74rem; }
.order-stack { display: flex; flex-direction: column; gap: 0.4rem; }
.order-stack .order-card { min-width: 0; max-width: none; width: 100%; }
h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
h3 { margin: 1rem 0 0.4rem; font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.lede { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin: 0 0 0.75rem; }
.card {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 0.85rem; margin-bottom: 0.55rem;
}
.card strong { display: block; margin-bottom: 0.25rem; }
.meta { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.chip {
  font-size: 0.72rem; padding: 0.15rem 0.45rem; border-radius: 999px;
  background: #0f1419; border: 1px solid var(--border); color: var(--muted);
}
.chip.ok { border-color: var(--up); color: var(--up); }
.chip.empty { border-color: var(--warn); color: var(--warn); }
.chip.bad { border-color: var(--danger); color: var(--danger); }
.orders { border-top: 1px solid var(--border); background: #141b23; padding: 0.65rem 1rem 0.75rem; }
.orders-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.orders-head h3 { margin: 0; }
.orders-track { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.order-card {
  min-width: 220px; max-width: 260px; background: var(--panel2);
  border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem 0.65rem; font-size: 0.8rem;
}
.order-card .title { font-weight: 600; margin-bottom: 0.25rem; }
.chat { border-top: 1px solid var(--border); display: flex; flex-direction: column; flex: 0 0 auto; max-height: 34%; min-height: 140px; background: #121820; }
.chat-head {
  padding: 0.45rem 0.85rem; font-size: 0.82rem; font-weight: 600;
  border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.chat-head span { color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.chat-log { flex: 1; overflow: auto; padding: 0.65rem 0.85rem; display: flex; flex-direction: column; gap: 0.45rem; }
.bubble-msg { max-width: 92%; padding: 0.5rem 0.7rem; border-radius: 12px; font-size: 0.85rem; line-height: 1.4; }
.bubble-msg.bot { align-self: flex-start; background: var(--panel2); border: 1px solid var(--border); }
.bubble-msg.user { align-self: flex-end; background: #1a3a55; border: 1px solid #2a5a80; }
.chat-form { display: flex; gap: 0.4rem; padding: 0.5rem 0.65rem 0.65rem; border-top: 1px solid var(--border); }
.chat-form input {
  flex: 1; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; color: var(--ink); padding: 0.5rem 0.65rem; font: inherit;
}
.chat-form button {
  background: var(--accent); color: #041018; border: 0; border-radius: 8px;
  padding: 0.5rem 0.85rem; font: inherit; font-weight: 600; cursor: pointer;
}
.suggestions { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0 0.65rem 0.35rem; }
.suggestions button {
  font-size: 0.7rem; background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 0.2rem 0.5rem; cursor: pointer;
}
.suggestions button:hover { color: var(--ink); border-color: var(--accent); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; margin-bottom: 0.75rem; }
.stat {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.55rem; text-align: center;
}
.stat .n { font-size: 1.25rem; font-weight: 700; font-family: var(--mono); }
.stat .l { font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }
.footer-note { font-size: 0.72rem; color: var(--muted); margin-top: 0.75rem; line-height: 1.4; }

.map-provider {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  gap: 0;
  background: rgba(255,255,255,.96);
  border: 1px solid #d0d7e2;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20,32,51,.12);
}
.map-provider button {
  border: 0;
  background: transparent;
  font: 600 12px/1 "IBM Plex Sans", system-ui, sans-serif;
  padding: 8px 12px;
  cursor: pointer;
  color: #445;
}
.map-provider button.active {
  background: #142033;
  color: #fff;
}
.map-hint #openGoogle { margin-left: .15rem; }

/* contextual blocks driven by top menu */
.side[data-show-orders="0"] .orders { display: none; }
.side .orders { border-top: 1px solid var(--border); background: #141b23; padding: 0.55rem 0.85rem 0.65rem; flex: 0 0 auto; max-height: 28%; overflow: auto; }

.photo-strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin-top: 0.5rem;
  padding-bottom: 0.15rem;
}
.photo-strip.empty { color: var(--muted); }
.photo-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0e12;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.order-card .photo-thumb { width: 84px; height: 64px; }
