/* Planta Viva — LP mínima + viewer + bancada */
:root {
  --pv-ink: #141816;
  --pv-muted: #5a6560;
  --pv-bg: #f3f1ec;
  --pv-card: #fff;
  --pv-line: #d8d3cb;
  --pv-accent: #1f6b4a;
  --pv-warn: #8a6a12;
  --pv-bad: #8a3030;
  --pv-font: "Figtree", system-ui, sans-serif;
  --pv-display: "Syne", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.pv {
  font-family: var(--pv-font);
  color: var(--pv-ink);
  background: var(--pv-bg);
  line-height: 1.45;
}
.pv a { color: var(--pv-accent); }
.pv .legal-top {
  margin: 0;
  padding: 0.65rem 1.25rem;
  background: #1a1f1c;
  color: #e8ebe9;
  font-size: 0.88rem;
  text-align: center;
}
.pv-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--pv-line);
  background: var(--pv-card);
}
.pv-nav .wordmark {
  font-family: var(--pv-display);
  font-weight: 700;
  text-decoration: none;
  color: var(--pv-ink);
  letter-spacing: -0.02em;
}
.pv-nav-links { display: flex; gap: 1rem; align-items: center; font-size: 0.92rem; }
.pv-nav-links a { text-decoration: none; color: var(--pv-muted); }
.pv-euros {
  list-style: none; margin: 1.25rem auto 0; padding: 0; max-width: 34rem;
  text-align: left; font-size: 0.95rem; color: var(--pv-ink);
}
.pv-euros li {
  margin: 0 0 0.65rem; padding: 0.65rem 0.75rem;
  background: var(--pv-card); border: 1px solid var(--pv-line);
  border-left: 3px solid var(--pv-accent);
}
.pv-euros li strong { display: block; margin-bottom: 0.15rem; font-size: 0.92rem; }
.pv-btn {
  display: inline-block;
  background: var(--pv-ink);
  color: #fff !important;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
.pv-btn.ghost { background: transparent; color: var(--pv-ink) !important; border: 1px solid var(--pv-line); }
.pv-home {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  text-align: center;
}
.pv-home h1 {
  font-family: var(--pv-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  line-height: 1.2;
}
.pv-home .price {
  font-size: 1.15rem;
  margin: 1.25rem 0;
  color: var(--pv-muted);
}
.pv-home .price strong { color: var(--pv-ink); font-size: 1.35rem; }
.pv-home .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }
.pv-home .hint { margin-top: 1.5rem; font-size: 0.88rem; color: var(--pv-muted); }

/* Viewer */
.pv-app { min-height: 100vh; display: flex; flex-direction: column; }
.pv-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center;
  padding: 0.75rem 1rem; background: var(--pv-card); border-bottom: 1px solid var(--pv-line);
}
.pv-toolbar label { font-size: 0.8rem; color: var(--pv-muted); display: flex; flex-direction: column; gap: 0.2rem; }
.pv-toolbar select {
  font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--pv-line); background: #fff;
}
.pv-esp {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto;
}
.pv-esp button {
  font: inherit; font-size: 0.8rem; padding: 0.35rem 0.65rem;
  border: 1px solid var(--pv-line); background: #fff; cursor: pointer; border-radius: 2px;
}
.pv-esp button.on { color: #fff; border-color: transparent; }
.pv-stage {
  flex: 1; display: grid; grid-template-columns: 1fr minmax(280px, 340px);
  min-height: 0;
}
@media (max-width: 860px) {
  .pv-stage { grid-template-columns: 1fr; }
}
.pv-map-wrap {
  position: relative; overflow: auto; background: #e8e4dc; padding: 1rem;
}
.pv-map {
  position: relative; display: inline-block; max-width: 100%;
}
.pv-map img { display: block; max-width: 100%; height: auto; }
.pv-pin {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #fff; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35); cursor: pointer; padding: 0;
}
.pv-pin.confirmado { outline: 2px solid var(--pv-accent); }
.pv-pin.provavel { outline: 2px solid var(--pv-warn); }
.pv-pin.incerto { outline: 2px solid var(--pv-bad); }
.pv-pin.is-demo {
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 0 3px rgba(180, 40, 40, 0.35);
}
.pv-pin-demo {
  position: absolute; left: 50%; top: -1.15rem; transform: translateX(-50%);
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.04em;
  color: #fff; background: #b42828; padding: 0.1rem 0.28rem; white-space: nowrap;
  pointer-events: none; line-height: 1.2;
}
.pv-detail {
  border-left: 1px solid var(--pv-line); background: var(--pv-card);
  padding: 1rem; overflow: auto;
}
.pv-detail h2 { font-family: var(--pv-display); font-size: 1.05rem; margin: 0 0 0.75rem; }
.pv-detail .empty { color: var(--pv-muted); font-size: 0.92rem; }
.pv-detail .badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.4rem; border-radius: 2px; margin-right: 0.35rem;
}
.pv-detail .badge.confirmado { background: #e4f3eb; color: var(--pv-accent); }
.pv-detail .badge.provavel { background: #f7f0d8; color: var(--pv-warn); }
.pv-detail .badge.incerto { background: #f7e4e4; color: var(--pv-bad); }
.pv-detail .demo-tag {
  background: #b42828; color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 0.15rem 0.4rem; vertical-align: middle;
}
.pv-detail .demo-banner {
  background: #f7e4e4; color: #7a1f1f; border: 1px solid #e0b0b0;
  font-size: 0.8rem; font-weight: 600; padding: 0.45rem 0.55rem; margin: 0 0 0.65rem;
}
.drill-banner {
  font-size: 0.82rem; font-weight: 500; padding: 0.5rem 0.6rem; margin: 0 0 0.65rem;
  border: 1px solid;
}
.drill-banner.no_drill {
  background: #f7e4e4; color: #7a1f1f; border-color: #e0b0b0;
}
.drill-banner.possible {
  background: #f7f0d8; color: #6a520e; border-color: #e0d4a0;
}
.drill-banner strong { display: block; margin-bottom: 0.2rem; font-size: 0.9rem; }
.pv-detail img { width: 100%; height: auto; display: block; margin: 0.5rem 0; border: 1px solid var(--pv-line); }
.pv-detail dl { margin: 0.75rem 0 0; font-size: 0.88rem; }
.pv-detail dt { color: var(--pv-muted); margin-top: 0.45rem; }
.pv-detail dd { margin: 0.15rem 0 0; }

/* Workbench 3 zones */
.pv-work {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr minmax(200px, 260px);
  min-height: calc(100vh - 52px);
}
@media (max-width: 960px) {
  .pv-work { grid-template-columns: 1fr; }
}
.pv-col {
  border-right: 1px solid var(--pv-line); background: var(--pv-card);
  display: flex; flex-direction: column; min-height: 320px;
}
.pv-col:last-child { border-right: none; border-left: 1px solid var(--pv-line); }
.pv-col h2 {
  margin: 0; padding: 0.75rem 0.85rem; font-size: 0.85rem; font-weight: 700;
  border-bottom: 1px solid var(--pv-line); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--pv-muted);
}
.pv-col-body { flex: 1; overflow: auto; padding: 0.65rem; }
.pv-inbox-lote { margin-bottom: 0.85rem; }
.pv-inbox-lote strong { font-size: 0.8rem; display: block; margin-bottom: 0.35rem; }
.pv-page-title {
  margin: 0;
  padding: 0.75rem 1.25rem 0.25rem;
  font-family: var(--pv-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pv-card {
  border: 1px solid var(--pv-line); padding: 0.45rem; margin-bottom: 0.45rem;
  cursor: grab; background: #faf9f7; font-size: 0.8rem;
}
.pv-card img { width: 100%; height: auto; display: block; margin-bottom: 0.35rem; }
.pv-card.dragging { opacity: 0.5; }
.pv-card.is-selected {
  outline: 2px solid var(--pv-accent);
  outline-offset: 1px;
}
.pv-card-hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--pv-muted);
  line-height: 1.3;
}
.pv-drop-hint {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(31,107,74,.18); font-weight: 700; pointer-events: none;
}
.pv-map-wrap.drag-over .pv-drop-hint { display: flex; }
.pv-conf {
  display: flex; gap: 0.35rem; margin-top: 0.5rem; flex-wrap: wrap;
}
.pv-conf button {
  font: inherit; font-size: 0.75rem; padding: 0.3rem 0.5rem; border: 1px solid var(--pv-line);
  background: #fff; cursor: pointer;
}
.pv-alert {
  border: 1px solid var(--pv-line); padding: 0.65rem; margin-bottom: 0.5rem; font-size: 0.85rem;
}
.pv-alert.alta { border-left: 3px solid var(--pv-bad); }
.pv-alert.media { border-left: 3px solid var(--pv-warn); }
.pv-footer-mini {
  padding: 0.5rem 1rem; font-size: 0.78rem; color: var(--pv-muted);
  border-top: 1px solid var(--pv-line); background: #faf9f7;
}

/* Chat FAB (LP Planta Viva — sem depender de app.css) */
.wr-chat {
  position: fixed; right: 1.1rem; bottom: 1.25rem; z-index: 13000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem;
  pointer-events: none;
}
.wr-chat-fab, .wr-chat-panel, .wr-chat-form, .wr-chat-x { pointer-events: auto; }
.wr-chat-fab {
  width: 3.4rem; height: 3.4rem; border: 0; border-radius: 999px; cursor: pointer;
  color: #fff; background: var(--pv-accent);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  display: grid; place-items: center;
}
.wr-chat-fab.is-open { background: var(--pv-ink); }
.wr-chat-panel {
  width: min(380px, calc(100vw - 1.5rem));
  height: min(480px, calc(100vh - 5.5rem));
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--pv-line); background: #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,.16);
}
.wr-chat-panel[hidden] { display: none !important; }
.wr-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--pv-line);
  background: #f7f9f7;
}
.wr-chat-brand { display: flex; align-items: center; gap: 0.55rem; }
.wr-chat-brand strong { display: block; font-family: var(--pv-display); font-size: 0.92rem; }
.wr-chat-brand span { display: block; font-size: 0.68rem; color: var(--pv-accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.wr-chat-dot { width: 0.65rem; height: 0.65rem; border-radius: 999px; background: var(--pv-accent); }
.wr-chat-x {
  width: 2rem; height: 2rem; border: 0; background: #eee; color: var(--pv-ink);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.wr-chat-msgs {
  flex: 1; min-height: 0; overflow-y: auto; padding: 0.85rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.wr-chat-row { display: flex; }
.wr-chat-row.is-user { justify-content: flex-end; }
.wr-chat-row.is-bot { justify-content: flex-start; }
.wr-chat-bubble {
  max-width: 88%; padding: 0.65rem 0.8rem; font-size: 0.875rem; line-height: 1.45;
  white-space: pre-wrap; border: 1px solid var(--pv-line); background: #f5f5f2;
}
.wr-chat-row.is-user .wr-chat-bubble {
  background: var(--pv-accent); color: #fff; border-color: transparent;
}
.wr-chat-form {
  display: flex; gap: 0.4rem; padding: 0.65rem; border-top: 1px solid var(--pv-line);
}
.wr-chat-form input {
  flex: 1; min-width: 0; border: 1px solid var(--pv-line); padding: 0.55rem 0.7rem;
  font: inherit; font-size: 0.9rem;
}
.wr-chat-form button {
  width: 2.5rem; border: 0; background: var(--pv-ink); color: #fff;
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
