/* ============================================================
   TheoTech — shared demo app styles
   Used by marina.html, pool.html, home-services.html
   ============================================================ */

body.demo { background: var(--sand); }

/* Persistent concept banner (required on every demo page) */
.concept-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink);
  color: #dfe8ee;
  font-size: .85rem;
  text-align: center;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.concept-banner strong { color: #fff; }
.concept-banner .cb-tag {
  background: var(--amber);
  color: #2a1a06;
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.concept-banner a { color: #9fd8d8; font-weight: 600; }

/* Demo app header */
.demo-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 39px;
  z-index: 55;
}
.demo-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}
.demo-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.demo-brand > div { min-width: 0; }
.demo-logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.demo-brand h1 { font-size: 1.15rem; margin: 0; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-brand .demo-fict { font-size: .72rem; color: var(--muted-2); font-weight: 500; }
.back-link { font-size: .88rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.back-link:hover { color: var(--teal-deep); text-decoration: none; }
.demo-header-actions { display: flex; align-items: center; gap: 16px; flex: none; }

.demo-main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }

/* View toggle (tabs) */
.tabs {
  display: inline-flex;
  background: #eee7d9;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
  flex-wrap: wrap;
}
.tab {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  color: var(--muted); padding: .5rem 1.1rem; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.view { display: none; }
.view.active { display: block; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.35rem; margin-bottom: .25rem; }
.panel .sub { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }

/* Legend */
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 600; line-height: 1; }
.stat .lbl { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.stat.ok .num { color: var(--teal-deep); }
.stat.warn .num { color: var(--amber); }

/* ---- Marina slip grid ---- */
.slip-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.slip {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .15s ease;
  position: relative;
  color: #fff;
  font-size: .95rem;
}
.slip:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.slip .slip-len { font-size: .68rem; font-weight: 500; opacity: .9; margin-top: 2px; }
.slip.available   { background: var(--teal); }
.slip.occupied    { background: #b0563e; }
.slip.reserved    { background: var(--amber); }
.slip.maintenance { background: #8a94a0; }
.dock-label { grid-column: 1 / -1; font-weight: 700; color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; }

/* Reservation / list tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1px; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; }
.data-table th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--line);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.pill {
  font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.pill.green { background: var(--teal-soft); color: var(--teal-deep); }
.pill.amber { background: #f8e9d5; color: #a5641f; }
.pill.red   { background: #f6ded6; color: #a34428; }
.pill.gray  { background: #e9edf0; color: #5c6b76; }
.empty-row td { text-align: center; color: var(--muted-2); padding: 28px; font-style: italic; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(12,34,51,.5);
  display: none; align-items: center; justify-content: center; z-index: 80; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.modal-head { padding: 22px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { font-size: 1.4rem; margin: 0; }
.modal-close { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 0 4px; }
.modal-body { padding: 16px 24px 24px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 20px; }
.spec { background: var(--sand); border-radius: var(--radius-sm); padding: 12px 14px; }
.spec .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.spec .v { font-weight: 600; font-size: 1rem; margin-top: 2px; }

.form-note { font-size: .82rem; color: var(--muted-2); margin-top: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: #b0563e; color: #fff; }
.btn-danger:hover { background: #964428; }

/* ---- Pool route ---- */
.day-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.day-btn {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: .85rem;
  padding: .55rem 1rem; border-radius: var(--radius-sm); color: var(--muted);
  transition: all .15s ease; text-align: center; min-width: 92px;
}
.day-btn .d-count { display: block; font-size: .72rem; font-weight: 500; color: var(--muted-2); margin-top: 2px; }
.day-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.day-btn.active .d-count { color: rgba(255,255,255,.85); }

.stop {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; margin-bottom: 14px; transition: border-color .15s ease;
}
.stop.done { background: #f4faf8; border-color: var(--teal-soft); }
.stop-num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
}
.stop.done .stop-num { background: var(--teal); }
.stop-body { flex: 1; min-width: 0; }
.stop-body h4 { margin: 0 0 2px; font-size: 1.05rem; }
.stop-body .addr { font-size: .88rem; color: var(--muted); margin: 0 0 6px; }
.stop-meta { font-size: .82rem; color: var(--muted-2); }
.stop-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.done-stamp { font-size: .78rem; color: var(--teal-deep); font-weight: 600; }

.reading-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: none; }
.reading-form.open { display: block; }
.reading-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.photo-drop {
  border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 18px;
  text-align: center; color: var(--muted-2); font-size: .85rem; cursor: pointer;
  background: var(--sand);
}
.photo-drop:hover { border-color: var(--teal); color: var(--teal-deep); }
.log-entry { font-size: .84rem; color: var(--muted); background: var(--sand); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; }

/* ---- Home services / invoice ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.job-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; background: #fff;
}
.job-card .job-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-card h4 { margin: 0 0 3px; font-size: 1.05rem; }
.job-card .job-meta { font-size: .85rem; color: var(--muted); }
.job-card .job-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.invoice {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; background: #fff;
}
.invoice-head { background: var(--ink); color: #fff; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; }
.invoice-head h4 { color: #fff; margin: 0; font-size: 1.1rem; }
.invoice-head .inv-num { font-size: .8rem; color: #9fb4c1; }
.invoice-body { padding: 18px 22px; }
.line-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.line-item .li-desc { color: var(--ink-2); }
.line-item.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 1.05rem; }
.invoice-foot { padding: 0 22px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.confirm-box {
  background: var(--teal-soft); border: 1px solid var(--teal); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-top: 16px; font-size: .9rem; color: var(--teal-deep);
}
.confirm-box strong { display: block; margin-bottom: 4px; color: var(--teal-deep); }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: .9rem; box-shadow: var(--shadow-lg); z-index: 90; transition: transform .3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.flow-step {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .95rem;
}

@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .slip-grid { grid-template-columns: repeat(4, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .reading-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .slip-grid { grid-template-columns: repeat(3, 1fr); }
  .demo-brand h1 { font-size: 1rem; }
  .spec-grid { grid-template-columns: 1fr; }
  .stop { flex-wrap: wrap; }
  .stop-actions { flex-direction: row; width: 100%; justify-content: space-between; }
  .demo-header-actions { gap: 10px; }
  .demo-header-actions .back-link { display: none; }
}

/* ============================================================
   HouseIQ demo — AI home assistant recreation
   ============================================================ */
.hq-layout { display: grid; grid-template-columns: 360px 1fr; gap: 36px; align-items: start; }

/* Phone frame */
.phone { width: 340px; max-width: 100%; margin: 0 auto; background: #0c2233; border-radius: 42px; padding: 12px; box-shadow: var(--shadow-lg); }
.phone-screen { background: #fff; border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; height: 610px; }

.hq-appbar { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 14px; }
.hq-appbar .hq-logo { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--teal); }
.hq-appbar h3 { color: #fff; margin: 0; font-size: 1rem; font-family: var(--font-body); font-weight: 700; }
.hq-appbar .hq-sub { font-size: .68rem; color: #9fb4c1; }

.hq-home { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.hq-home .hq-home-name { font-size: .74rem; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.hq-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.hq-chip { background: var(--teal-soft); color: var(--teal-deep); border-radius: 999px; padding: 3px 8px; font-size: .66rem; font-weight: 600; }

.hq-chat { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--sand); }
.hq-msg { max-width: 85%; padding: 9px 12px; border-radius: 15px; font-size: .8rem; line-height: 1.45; white-space: pre-line; }
.hq-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink-2); border-bottom-left-radius: 4px; }
.hq-msg.user { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.hq-msg strong { font-weight: 700; }
.hq-typing { align-self: flex-start; display: inline-flex; gap: 3px; padding: 11px 13px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.hq-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); animation: hqblink 1.2s infinite; }
.hq-typing i:nth-child(2) { animation-delay: .2s; }
.hq-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes hqblink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

.hq-suggest { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); background: #fff; }
.hq-suggest button { flex: none; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: .7rem; cursor: pointer; color: var(--ink-2); white-space: nowrap; font-family: var(--font-body); }
.hq-suggest button:hover { border-color: var(--teal); color: var(--teal-deep); }
.hq-inputbar { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; align-items: center; }
.hq-inputbar input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; font-size: .8rem; font-family: var(--font-body); background: var(--paper); }
.hq-inputbar input:focus { outline: none; border-color: var(--teal); }
.hq-send { border: 0; background: var(--teal); color: #fff; border-radius: 50%; width: 36px; height: 36px; flex: none; cursor: pointer; display: grid; place-items: center; }
.hq-send:hover { background: var(--teal-deep); }
.phone-caption { text-align: center; font-size: .78rem; color: var(--muted-2); margin: 14px auto 0; max-width: 320px; }

/* Feature list for "what we built" */
.hq-features { list-style: none; padding: 0; margin: 0; }
.hq-features li { position: relative; padding-left: 30px; margin-bottom: 14px; color: var(--ink-2); font-size: .95rem; }
.hq-features li svg { position: absolute; left: 0; top: 2px; color: var(--teal); }
.hq-features li strong { display: block; }
.hq-features li span { color: var(--muted); font-size: .88rem; }

/* Screenshot gallery (placeholders until real screens are added) */
.hq-shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; }
.hq-shot { background: #0c2233; border-radius: 24px; padding: 6px; }
.hq-shot-screen { border-radius: 19px; overflow: hidden; background: var(--sand); aspect-ratio: 9 / 19; display: grid; place-items: center; text-align: center; position: relative; }
.hq-shot-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hq-shot-ph { padding: 14px 10px; color: var(--muted-2); }
.hq-shot-ph .ph-cam { font-size: 1.4rem; opacity: .5; }
.hq-shot-ph .ph-label { font-size: .72rem; margin-top: 6px; font-weight: 600; color: var(--muted); }
.hq-shot-ph .ph-hint { font-size: .64rem; margin-top: 3px; }

@media (max-width: 820px) {
  .hq-layout { grid-template-columns: 1fr; gap: 28px; }
  .hq-shots { grid-template-columns: repeat(2, 1fr); }
}
