/* ═══════════════════════════════════════════════════
   AI CONCIERGE — 2026-09-24
   Loaded after the skin, so it reads that skin's variables
   (--accent, --bg-card, --text …) and works on a / c / e alike.
   ═══════════════════════════════════════════════════ */

#pageAi.active { display:flex !important; flex-direction:column; height:calc(100vh - 146px); padding:0; }
#pageAi .ai-chat { flex:1; overflow-y:auto; padding:16px 16px 8px; display:flex; flex-direction:column; gap:14px; scroll-behavior:smooth; }

/* ── Welcome ── */
.cg-welcome { display:flex; flex-direction:column; gap:18px; padding:8px 0 4px; animation:cgIn .35s ease both; }
.cg-hero {
  text-align:center; padding:26px 18px 22px; border-radius:var(--radius-md);
  background:linear-gradient(160deg, var(--accent-soft), var(--bg-card) 70%);
  border:1px solid var(--border);
}
.cg-hero h3 { font-size:20px; font-weight:700; color:var(--text); margin:12px 0 6px; }
.cg-hero p { font-size:14px; line-height:1.5; color:var(--text-secondary); max-width:420px; margin:0 auto; }
.cg-live {
  display:inline-flex; align-items:center; gap:6px; margin-top:12px; padding:4px 10px;
  border-radius:999px; font-size:11px; font-weight:600; letter-spacing:.3px;
  background:var(--success-bg); color:var(--success);
}
.cg-live::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; animation:cgPulse 1.6s ease-in-out infinite; }
.cg-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:1px; color:var(--text-muted); margin:0 2px -8px; }
.cg-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
.cg-chip {
  display:flex; align-items:center; gap:10px; min-height:56px; padding:12px; text-align:left;
  border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-card);
  color:var(--text); font-family:var(--font); font-size:13px; font-weight:600; line-height:1.25;
  cursor:pointer; box-shadow:var(--shadow-sm); transition:transform .12s ease, border-color .12s ease;
}
.cg-chip:hover { border-color:var(--accent); }
.cg-chip:active { transform:scale(.97); }
.cg-chip-ic { font-size:20px; flex-shrink:0; width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:var(--accent-soft); }
.cg-note { font-size:11px; color:var(--text-muted); text-align:center; line-height:1.4; }

/* ── Avatar ── */
.cg-avatar {
  width:30px; height:30px; flex-shrink:0; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:16px; background:var(--accent-soft); border:1px solid var(--border);
}
.cg-avatar.lg { width:64px; height:64px; font-size:32px; margin:0 auto; box-shadow:var(--shadow-md); background:var(--bg-card); }

/* ── Conversation ── */
.cg-toolbar { display:flex; justify-content:flex-end; margin-bottom:-4px; }
.cg-new {
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  border:1px solid var(--border-input); background:var(--bg-card); color:var(--text-secondary);
  font-family:var(--font); font-size:12px; font-weight:600; cursor:pointer;
}
.cg-new:hover { color:var(--text); border-color:var(--accent); }
.cg-row { display:flex; gap:8px; align-items:flex-end; animation:cgIn .25s ease both; }
.cg-row.user { justify-content:flex-end; }
.cg-row.ai { align-items:flex-start; }
.cg-col { display:flex; flex-direction:column; gap:6px; max-width:84%; min-width:0; }
.cg-bubble { padding:11px 14px; border-radius:18px; font-size:14px; line-height:1.5; word-wrap:break-word; overflow-wrap:anywhere; }
.cg-row.user .cg-bubble { background:var(--accent); color:#fff; border-bottom-right-radius:6px; max-width:84%; }
.cg-row.ai .cg-bubble { background:var(--bg-card); color:var(--text); border:1px solid var(--border); border-top-left-radius:6px; box-shadow:var(--shadow-sm); }
.cg-row.ai .cg-bubble.err { background:var(--danger-bg); border-color:transparent; color:var(--danger); }
.cg-bubble p { margin:0 0 8px; }
.cg-bubble p:last-child, .cg-bubble ul:last-child, .cg-bubble ol:last-child { margin-bottom:0; }
.cg-bubble ul, .cg-bubble ol { margin:4px 0 8px; padding-left:20px; }
.cg-bubble li { margin:3px 0; }
.cg-bubble li::marker { color:var(--text-muted); }
.cg-bubble strong { font-weight:700; }
.cg-bubble .cg-h { font-weight:700; font-size:14px; margin:8px 0 4px; }
.cg-bubble a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
.cg-row.ai .cg-bubble a { color:var(--info-text); }

/* sources + follow-up action under an answer */
.cg-sources { display:flex; flex-wrap:wrap; gap:6px; }
.cg-src {
  display:inline-flex; align-items:center; gap:5px; max-width:100%; padding:4px 10px; border-radius:999px;
  background:var(--bg-input); border:1px solid var(--border); color:var(--text-secondary);
  font-size:11px; font-weight:600; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cg-src:hover { color:var(--text); border-color:var(--accent); }
.cg-src img { width:12px; height:12px; border-radius:2px; }
.cg-act {
  align-self:flex-start; display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px;
  border:none; background:var(--accent); color:#fff; font-family:var(--font); font-size:13px; font-weight:600; cursor:pointer;
}
.cg-retry { align-self:flex-start; padding:6px 12px; border-radius:999px; border:1px solid var(--danger); background:transparent; color:var(--danger); font-family:var(--font); font-size:12px; font-weight:600; cursor:pointer; }

/* ── Progress card (while the answer is being fetched) ── */
.cg-progress {
  width:100%; max-width:320px; padding:12px 14px; border-radius:18px; border-top-left-radius:6px;
  background:var(--bg-card); border:1px solid var(--border); box-shadow:var(--shadow-sm);
}
.cg-steps { display:flex; flex-direction:column; gap:7px; }
.cg-step { display:flex; align-items:center; gap:9px; font-size:13px; color:var(--text-muted); transition:color .2s ease; }
.cg-step .cg-dot { width:16px; height:16px; flex-shrink:0; border-radius:50%; border:2px solid var(--border-input); display:flex; align-items:center; justify-content:center; font-size:10px; line-height:1; }
.cg-step.active { color:var(--text); font-weight:600; }
.cg-step.active .cg-dot { border-color:var(--accent); border-right-color:transparent; animation:cgSpin .8s linear infinite; }
.cg-step.done { color:var(--text-secondary); }
.cg-step.done .cg-dot { border-color:var(--success); background:var(--success); color:#fff; }
.cg-step.done .cg-dot::after { content:'✓'; }
.cg-bar { position:relative; height:4px; margin-top:12px; border-radius:4px; background:var(--bg-input); overflow:hidden; }
.cg-bar span { position:absolute; left:0; top:0; bottom:0; width:0; border-radius:4px; background:var(--accent); transition:width .4s ease; }
.cg-bar span::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation:cgShine 1.2s linear infinite; }
.cg-meta { display:flex; justify-content:space-between; margin-top:6px; font-size:11px; color:var(--text-muted); }
.cg-typing { display:inline-flex; gap:3px; }
.cg-typing i { width:5px; height:5px; border-radius:50%; background:var(--text-muted); animation:cgBounce 1.2s infinite ease-in-out; }
.cg-typing i:nth-child(2) { animation-delay:.15s; }
.cg-typing i:nth-child(3) { animation-delay:.3s; }

/* ── Input ── */
#pageAi .cg-input-row { gap:8px; padding:10px 12px; align-items:center; }
#pageAi .cg-input-row input { border-radius:999px; padding:12px 16px; }
#pageAi .cg-input-row .btn-send { border-radius:50%; transition:opacity .15s ease, transform .12s ease; }
#pageAi .cg-input-row .btn-send:active { transform:scale(.92); }
#pageAi .cg-input-row .btn-send[disabled] { opacity:.45; cursor:default; }

@keyframes cgIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@keyframes cgSpin { to { transform:rotate(360deg); } }
@keyframes cgPulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }
@keyframes cgBounce { 0%,80%,100% { transform:translateY(0); opacity:.5; } 40% { transform:translateY(-4px); opacity:1; } }
@keyframes cgShine { from { transform:translateX(-100%); } to { transform:translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .cg-welcome, .cg-row, .cg-step.active .cg-dot, .cg-bar span::after, .cg-typing i, .cg-live::before { animation:none; }
}
@media (min-width:768px) {
  #pageAi .ai-chat { padding:24px 32px 12px; }
  .cg-welcome { max-width:640px; width:100%; margin:0 auto; }
  .cg-grid { grid-template-columns:repeat(3, minmax(0,1fr)); }
  .cg-col { max-width:70%; }
}

/* ── Two-lane cards (2026-09-24): Useful Info, Google Maps places, forecast ── */
.cg-card { width:100%; }
.cg-card-title { font-weight:700; font-size:14px; margin-bottom:6px; }
.cg-card-note { font-size:12px; color:var(--text-secondary); margin:-2px 0 8px; }
.cg-row.ai .cg-bubble.cg-empty { background:var(--warning-bg); border-color:transparent; }
.cg-btns { display:flex; flex-wrap:wrap; gap:8px; }
.cg-link {
  display:inline-flex; align-items:center; gap:4px; padding:8px 14px; border-radius:999px;
  border:1px solid var(--border-input); background:var(--bg-card); color:var(--text);
  font-size:13px; font-weight:600; text-decoration:none;
}
.cg-link:hover { border-color:var(--accent); }
.cg-places { display:flex; flex-direction:column; margin:0 -14px; }
.cg-place { padding:10px 14px; border-top:1px solid var(--border); }
.cg-place:first-child { border-top:none; padding-top:4px; }
.cg-place-name { font-weight:700; font-size:14px; }
.cg-place-meta { font-size:12px; color:var(--text-secondary); margin-top:2px; }
.cg-place-addr { font-size:12px; color:var(--text-secondary); margin-top:2px; }
.cg-place-acts { display:flex; gap:14px; margin-top:6px; }
.cg-place-acts a { font-size:12px; font-weight:600; color:var(--info-text); text-decoration:none; }
.cg-stars { color:#E8A317; font-weight:700; }
.cg-dim { color:var(--text-muted); font-weight:400; }
.cg-pill { display:inline-block; padding:1px 7px; border-radius:999px; font-size:11px; font-weight:600; }
.cg-pill.open { background:var(--success-bg); color:var(--success); }
.cg-pill.closed { background:var(--danger-bg); color:var(--danger); }
.cg-attrib { font-size:10px; color:var(--text-muted); margin-top:8px; text-align:right; }
.cg-wx { display:flex; flex-direction:column; }
.cg-wx-row { display:grid; grid-template-columns:78px 1fr auto; gap:8px; align-items:baseline; padding:7px 0; border-top:1px solid var(--border); font-size:13px; }
.cg-wx-row:first-child { border-top:none; padding-top:2px; }
.cg-wx-day { font-weight:700; }
.cg-wx-sum { color:var(--text-secondary); }
.cg-wx-t { white-space:nowrap; }

/* ── Place results, redesigned 2026-09-25 (Gil: "make it look good") ── */
.cg-row.ai .cg-bubble.cg-area { padding:0; overflow:hidden; }
.cg-hdr {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  background:linear-gradient(135deg, #1a73e8, #34a853); color:#fff;
}
.cg-hdr-ic { width:40px; height:40px; flex-shrink:0; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; background:rgba(255,255,255,.22); }
.cg-hdr-t { font-size:15px; font-weight:700; line-height:1.2; }
.cg-hdr-s { font-size:12px; opacity:.9; margin-top:2px; }
.cg-map { display:block; width:100%; height:190px; border:0; border-bottom:1px solid var(--border); }
.cg-area .cg-card-note { padding:10px 16px 0; margin:0; }
.cg-area .cg-places { margin:0; }
.cg-area .cg-place { display:flex; gap:12px; padding:12px 16px; border-top:1px solid var(--border); }
.cg-area .cg-place:first-child { border-top:none; padding-top:12px; }
.cg-num {
  width:26px; height:26px; flex-shrink:0; border-radius:50%;
  display:flex; align-items:center; justify-content:center; margin-top:2px;
  background:#ea4335; color:#fff; font-size:12px; font-weight:700; box-shadow:0 2px 4px rgba(0,0,0,.2);
}
.cg-place-body { min-width:0; flex:1; }
.cg-area .cg-place-name { font-size:15px; }
.cg-area .cg-place-meta { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.cg-chip-sm { display:inline-flex; align-items:center; gap:3px; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; background:var(--bg-input); color:var(--text-secondary); }
.cg-chip-sm.cg-rate { background:#fef7e0; color:#b06000; }
.cg-chip-sm.cg-rate span { font-weight:400; opacity:.8; }
.cg-chip-sm.open { background:var(--success-bg); color:var(--success); }
.cg-chip-sm.closed { background:var(--danger-bg); color:var(--danger); }
.cg-area .cg-place-addr { margin-top:5px; }
.cg-area .cg-place-acts { gap:8px; margin-top:8px; }
.cg-pbtn {
  display:inline-flex; align-items:center; gap:5px; padding:7px 12px; border-radius:999px;
  border:1px solid var(--border-input); background:var(--bg-card); color:var(--text) !important;
  font-size:12px; font-weight:700; text-decoration:none;
}
.cg-pbtn.go { background:#1a73e8; border-color:#1a73e8; color:#fff !important; }
.cg-allmap {
  display:flex; align-items:center; justify-content:center; gap:6px; margin:4px 16px 0; padding:11px;
  border-radius:12px; background:#e8f0fe; color:#1a73e8; font-size:13px; font-weight:700; text-decoration:none;
}
.cg-area .cg-attrib { padding:6px 16px 10px; margin:0; }

/* No list to show yet: a map tile that opens the search in Google Maps */
.cg-maptile {
  display:flex; flex-direction:column; width:100%; max-width:340px; border-radius:18px; border-top-left-radius:6px;
  overflow:hidden; text-decoration:none; color:var(--text); background:var(--bg-card);
  border:1px solid var(--border); box-shadow:var(--shadow-sm);
}
.cg-maptile-map {
  position:relative; display:flex; align-items:center; justify-content:center; height:104px;
  background-color:#e8f0e3;
  background-image:
    linear-gradient(90deg, transparent 38%, #fff 38%, #fff 42%, transparent 42%),
    linear-gradient(0deg, transparent 55%, #fff 55%, #fff 61%, transparent 61%),
    linear-gradient(25deg, transparent 72%, #cfe3f7 72%, #cfe3f7 80%, transparent 80%),
    radial-gradient(circle at 82% 28%, #d2e8cb 0 16%, transparent 17%),
    radial-gradient(circle at 15% 78%, #f3e9c6 0 12%, transparent 13%);
}
.cg-maptile-ic {
  width:50px; height:50px; border-radius:50% 50% 50% 0; transform:rotate(-45deg);
  display:flex; align-items:center; justify-content:center; background:#ea4335; box-shadow:0 4px 10px rgba(0,0,0,.25);
  font-size:24px; margin-top:-10px;
}
.cg-maptile-ic { background:#fff; border:3px solid #ea4335; }
.cg-maptile-ic i { font-style:normal; transform:rotate(45deg); line-height:1; }
.cg-maptile-bar { display:flex; align-items:center; gap:10px; padding:12px 14px; }
.cg-maptile-txt { display:flex; flex-direction:column; min-width:0; flex:1; }
.cg-maptile-t { font-size:14px; font-weight:700; }
.cg-maptile-s { font-size:12px; color:var(--text-secondary); margin-top:2px; }
.cg-maptile-go { flex-shrink:0; padding:8px 12px; border-radius:999px; background:#1a73e8; color:#fff; font-size:12px; font-weight:700; }

/* ── 2026-09-25: wide screens — a readable centred column, not full width ── */
@media (min-width:768px) {
  #pageAi .ai-chat > * { width:100%; max-width:760px; margin-left:auto; margin-right:auto; }
  #pageAi .ai-chat .cg-col { max-width:86%; }
  #pageAi .ai-chat .cg-row.user .cg-bubble { max-width:70%; }
  #pageAi .cg-input-row { padding-left:max(16px, calc((100% - 760px) / 2)); padding-right:max(16px, calc((100% - 760px) / 2)); }
  #pageAi .cg-bubble { font-size:15px; }
}

/* Map button after a place the AI names */
.cg-maplink {
  display:inline-flex; align-items:center; gap:3px; margin-left:4px; padding:1px 9px; border-radius:999px;
  background:#e8f0fe; color:#1a73e8 !important; font-size:12px; font-weight:700; text-decoration:none !important;
  white-space:nowrap; vertical-align:1px;
}
.cg-maplink:hover { background:#d2e3fc; }
.cg-bubble li + li { margin-top:8px; }

/* ── Willow (2026-09-25 per Gil): the concierge's face, in the chat and as a chat head ── */
.wl-av {
  position:relative; width:32px; height:32px; flex-shrink:0; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  background:linear-gradient(145deg, #3f8f5a, #1f5f3f); color:#fff;
  font-family:Georgia, 'Times New Roman', serif; font-size:16px; font-weight:700; font-style:italic;
  box-shadow:0 2px 6px rgba(31,95,63,.35);
}
.wl-av i { position:absolute; right:-1px; bottom:-1px; width:10px; height:10px; border-radius:50%; background:#34c759; border:2px solid var(--bg-card); }
.wl-av-lg { width:72px; height:72px; font-size:34px; margin:0 auto; }
.wl-av-lg i { width:16px; height:16px; border-width:3px; right:2px; bottom:2px; }
.cg-row.ai > .wl-av { margin-top:2px; }
.cg-or { text-align:center; font-size:13px; font-weight:600; color:var(--text-secondary); margin-top:-4px; }
.cg-act.cg-compose { background:#1a73e8; }

/* Floating chat head */
.wl-head { position:fixed; right:16px; bottom:calc(92px + env(safe-area-inset-bottom, 0px)); z-index:1500; display:flex; align-items:flex-end; gap:10px; }
.wl-head-btn { padding:0; border:none; background:none; cursor:pointer; border-radius:50%; }
.wl-av-head { width:58px; height:58px; font-size:28px; box-shadow:0 6px 18px rgba(31,95,63,.45); transition:transform .15s ease; animation:wlPop .4s ease both; }
.wl-av-head i { width:14px; height:14px; border-width:3px; right:1px; bottom:1px; }
.wl-head-btn:hover .wl-av-head { transform:scale(1.06); }
.wl-head-btn:active .wl-av-head { transform:scale(.94); }
.wl-hi {
  position:relative; max-width:230px; padding:12px 30px 12px 14px; border-radius:16px; border-bottom-right-radius:4px;
  background:var(--bg-card); color:var(--text); box-shadow:var(--shadow-lg); border:1px solid var(--border);
  display:flex; flex-direction:column; gap:3px; font-size:13px; line-height:1.35; cursor:pointer;
  opacity:0; transform:translateY(8px) scale(.96); pointer-events:none; transition:opacity .25s ease, transform .25s ease;
}
.wl-hi.show { opacity:1; transform:none; pointer-events:auto; }
.wl-hi strong { font-size:14px; }
.wl-hi span { color:var(--text-secondary); }
.wl-hi-x { position:absolute; top:4px; right:6px; width:22px; height:22px; border:none; background:none; color:var(--text-muted); font-size:16px; line-height:1; cursor:pointer; }
@keyframes wlPop { from { transform:scale(.6); opacity:0; } to { transform:none; opacity:1; } }
@media (prefers-reduced-motion: reduce) { .wl-av-head { animation:none; } .wl-hi { transition:none; } }
@media (min-width:768px) { .wl-head { right:28px; bottom:32px; } }

/* 2026-09-25: Willow's face is Gil's script W (img/willow-w-*.webp, rebuilt on a solid circle) */
.wl-av { background:#0c4535; box-shadow:0 2px 6px rgba(12,69,53,.35); }
.wl-av img { width:100%; height:100%; border-radius:50%; display:block; object-fit:cover; }
.wl-av-head { box-shadow:0 6px 18px rgba(12,69,53,.45); }

/* Mess report card (2026-09-25) */
.cg-report p { margin:0 0 10px; }
.rp-q { margin:10px 0 4px; }
.rp-label { font-size:13px; font-weight:700; color:var(--text); margin-bottom:6px; }
.rp-opts { display:flex; flex-wrap:wrap; gap:6px; }
.rp-opt {
  padding:7px 12px; border-radius:999px; border:1px solid var(--border-input); background:var(--bg-card);
  color:var(--text); font-family:var(--font); font-size:13px; cursor:pointer;
}
.rp-opt.on { background:#1a73e8; border-color:#1a73e8; color:#fff; font-weight:600; }
.rp-other { width:100%; margin-top:8px; padding:9px 12px; border:1px solid var(--border-input); border-radius:10px; font-family:var(--font); font-size:14px; background:var(--bg-input); color:var(--text); box-sizing:border-box; }
.rp-err { margin-top:8px; font-size:12px; color:var(--danger); }
.cg-act.rp-send { margin-top:12px; background:#1a73e8; }
.rp-label.rp-exact { margin:10px 0 0; }
.rp-label.rp-exact span { font-weight:400; color:var(--text-muted); }

/* Repair report (2026-09-26) */
textarea.rp-desc { resize:vertical; min-height:52px; line-height:1.4; }
.rp-emerg { margin-top:10px; padding:10px 12px; border-radius:10px; background:var(--danger-bg); color:var(--danger); font-size:13px; line-height:1.45; }
.rp-call { display:inline-block; margin-top:6px; padding:6px 12px; border-radius:999px; background:var(--danger); color:#fff !important; font-weight:700; text-decoration:none; }
