/* Comunidades kit — WhatsApp mock · panel conserje · flow player */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #F3F3F3;
  color: #1F2937;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #E0E0E0;
}
.site-brand {
  display: inline-flex;
  align-items: center;
}
.site-brand img {
  height: 26px;
}
.site-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.site-link {
  color: #4B5563;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  background: #374151;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #374151;
  transition: background .2s ease, border-color .2s ease;
}
.site-cta:hover {
  background: #1F2937;
  border-color: #1F2937;
}

.layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  min-height: calc(100vh - 75px);
  max-width: 1440px;
  margin: 0 auto;
}

/* ── WhatsApp side ─────────────────────────────── */
.phone-col {
  background: #F7F7F5;
  padding: 2rem 1.5rem;
  border-right: 1px solid #E0E0E0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.phone-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6B7280;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.phone {
  width: 360px;
  height: 700px;
  background: #000;
  border-radius: 40px;
  padding: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,.12);
  flex-shrink: 0;
}
.phone-inner {
  width: 100%; height: 100%;
  background: #EFE7DD;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wa-status {
  height: 26px;
  background: #075E54;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, sans-serif;
}
.wa-header {
  background: #128C7E;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, sans-serif;
}
.wa-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff;
  color: #128C7E;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.wa-name { font-size: 14px; font-weight: 600; }
.wa-sub { font-size: 11px; opacity: .8; }

.wa-chat {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #EFE7DD url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='1' fill='%23d9cfc0' opacity='.5'/></svg>");
  scroll-behavior: smooth;
}
.wa-chat::-webkit-scrollbar { width: 4px; }
.wa-chat::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 2px; }

.bubble {
  max-width: 85%;
  padding: 6px 9px 18px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  font-family: -apple-system, sans-serif;
  color: #111B21;
  white-space: normal;
  word-break: break-word;
  animation: bubbleIn .25s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.bubble .time {
  position: absolute;
  right: 8px; bottom: 4px;
  font-size: 10px; color: #667781;
  white-space: nowrap;
}
.bubble.them {
  background: #fff;
  align-self: flex-start;
  border-top-left-radius: 0;
}
.bubble.me {
  background: #D9FDD3;
  align-self: flex-end;
  border-top-right-radius: 0;
}
.bubble .read { color: #53BDEB; }

.bubble.sys {
  align-self: center;
  background: rgba(225, 245, 254, .9);
  color: #1B4F5C;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
  letter-spacing: .02em;
  animation: sysIn .35s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes sysIn { from { opacity: 0; transform: scale(.92); } }

.bubble.typing {
  padding: 10px 12px;
  display: flex;
  gap: 4px;
  align-items: center;
  width: fit-content;
}
.bubble.typing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8696a0;
  animation: typing 1s infinite ease-in-out;
}
.bubble.typing .dot:nth-child(2) { animation-delay: .15s; }
.bubble.typing .dot:nth-child(3) { animation-delay: .30s; }
@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.bubble.is-quick {
  background: #E7F7EE;
  border: 1px solid #B7E1C4;
  color: #0F5132;
  font-weight: 500;
}

/* Quick replies (shown inside "them" bubbles) */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #E5EAE8;
}
.quick-replies .qr {
  display: inline-block;
  padding: 5px 10px;
  background: #f6f6f6;
  border: 1px solid #dfe5e3;
  border-radius: 14px;
  font-size: 12px;
  color: #128C7E;
  font-weight: 500;
}

/* Package photo — stylized "image" attached to a bubble */
.pkg-photo {
  --pkg: #FF9900;
  margin: -2px -3px 4px;
}
.pkg-photo-inner {
  background: linear-gradient(135deg, #f3ede4, #e5dbc8);
  border-radius: 4px;
  padding: 14px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.pkg-photo-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.5), transparent 60%);
  pointer-events: none;
}
.pkg-box {
  width: 100px; height: 70px;
  background: #d4c09a;
  border: 2px solid #b29868;
  border-radius: 3px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
}
.pkg-box::before {
  content: "";
  position: absolute;
  top: -2px; left: 10%; right: 10%;
  height: 10px;
  background: var(--pkg);
  border: 2px solid rgba(0,0,0,.15);
  border-top: none;
  border-radius: 0 0 2px 2px;
}
.pkg-brand {
  position: relative; z-index: 1;
  color: var(--pkg);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(0,0,0,.1);
}
.pkg-tape {
  position: absolute;
  left: -4px; right: -4px;
  top: 45%;
  height: 8px;
  background: rgba(0,0,0,.08);
}
.pkg-meta {
  font-size: 11px;
  color: #5a4a30;
  font-weight: 500;
}

/* Package picker — shown in bot bubbles for partial pickup */
.pkg-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.pp-item {
  --pkg: #888;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #f8f9f9;
  border: 1px solid #E5EAE8;
  border-radius: 6px;
  transition: background .3s ease, border-color .3s ease;
}
.pp-photo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #e8dec8, #c6b187);
  border: 1.5px solid var(--pkg);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.pp-photo::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 6px;
  background: var(--pkg);
}
.pp-brand {
  position: relative; z-index: 1;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,.55);
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: .02em;
}
.pp-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #1F2937;
  font-weight: 600;
}
.pp-box {
  font-size: 11px;
  color: #667781;
}
.pp-actions {
  display: flex;
  gap: 4px;
}
.pp-btn {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dfe5e3;
  color: #667781;
  font-weight: 500;
  transition: all .2s ease;
}
.pp-btn.active {
  transform: scale(1.05);
}
.pp-btn.active.take {
  background: #128C7E;
  color: #fff;
  border-color: #128C7E;
}
.pp-btn.active.skip {
  background: #E5EAE8;
  color: #667781;
}
.pp-item.decided.take { background: #E7F7EE; border-color: #B7E1C4; }
.pp-item.decided.skip { background: #FDF3F3; border-color: #F0D4D4; opacity: .7; }

/* Code input bubble — looks like typed code */
.code-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  letter-spacing: .1em;
  color: #075E54;
  font-weight: 600;
}

/* Composer */
.wa-composer {
  background: #F0F0F0;
  padding: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.wa-composer input {
  flex: 1;
  border: 0;
  background: #fff;
  border-radius: 20px;
  padding: 10px 14px;
  font-family: -apple-system, sans-serif;
  font-size: 13px;
  outline: none;
}
.composer-btn {
  border: 0;
  background: transparent;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: #54656F;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.composer-btn.primary {
  background: #128C7E;
  color: #fff;
}

/* Flow controls */
.flow-ctl {
  margin-top: 1rem;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.ctl-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #1F2937;
  background: #fff;
  border: 1px solid #D0D0D0;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 2px;
  letter-spacing: .02em;
  transition: background .15s ease, border-color .15s ease;
}
.ctl-btn:hover { background: #F5F5F5; border-color: #999; }
.ctl-btn.ghost { background: transparent; border-color: #E0E0E0; color: #6B7280; }

.flow-progress {
  margin-top: 10px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
#stepCounter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6B7280;
  letter-spacing: .08em;
}
.flow-progress .bar {
  width: 100%;
  height: 2px;
  background: #E0E0E0;
  border-radius: 1px;
  overflow: hidden;
}
.flow-progress .fill {
  height: 100%;
  width: 0%;
  background: #128C7E;
  transition: width .4s cubic-bezier(.22,.61,.36,1);
}

/* ── Right panel ───────────────────────────────── */
.panel {
  padding: 2.5rem 3rem 4rem;
  background: #fff;
  min-height: 100vh;
}
.panel-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6B7280;
  margin-bottom: .5rem;
}
.product-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}
.summary-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  padding: 1rem;
}
.summary-card strong {
  display: block;
  margin-bottom: .45rem;
  font-size: 16px;
  color: #111827;
}
.summary-card p {
  font-size: 13px;
  line-height: 1.6;
  color: #4B5563;
}
.summary-label {
  display: inline-block;
  margin-bottom: .6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6B7280;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  border-bottom: 1px solid #E0E0E0;
  padding-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.panel-head h1 {
  font-size: 1.5rem; font-weight: 700; color: #374151;
  margin-bottom: .25rem;
  letter-spacing: -.01em;
}
.panel-head .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: #6B7280;
}

.flow-switch {
  display: inline-flex;
  border: 1px solid #E0E0E0;
  border-radius: 2px;
  overflow: hidden;
}
.fs-btn {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  background: #fff;
  border: 0;
  color: #6B7280;
  cursor: pointer;
  border-right: 1px solid #E0E0E0;
}
.fs-btn:last-child { border-right: 0; }
.fs-btn.active { background: #1F2937; color: #fff; }
.fs-btn:hover:not(.active) { background: #F5F5F5; color: #1F2937; }

/* Narration panel */
.narration {
  background: linear-gradient(135deg, #FAFAF9 0%, #F4F2EE 100%);
  border: 1px solid #E5E2DA;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  border-radius: 4px;
  transition: border-color .3s ease;
  position: relative;
  overflow: hidden;
}
.narration::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #128C7E;
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform .4s cubic-bezier(.22,.61,.36,1);
}
.narration.bump::before { transform: scaleY(1); }
.narration.bump {
  border-color: #128C7E;
}
.narration-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.n-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  color: #128C7E;
  font-weight: 600;
}
.n-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6B7280;
  letter-spacing: .08em;
}
.narration h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1F2937;
  line-height: 1.3;
  letter-spacing: -.015em;
  margin-bottom: .5rem;
  transition: color .3s ease;
}
.narration p {
  font-size: 14px;
  color: #4B5563;
  line-height: 1.55;
  max-width: 62ch;
}

.n-principles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #D4D0C4;
}
.chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .04em;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #D4D0C4;
  color: #374151;
  border-radius: 999px;
}

/* State card */
.state {
  margin-bottom: 2rem;
}
.state-card {
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  padding: 4px 0;
}
.state-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: 12px 16px;
  border-bottom: 1px solid #F0F0F0;
  align-items: center;
}
.state-row:last-child { border-bottom: 0; }
.state-row .lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6B7280;
}
.state-row .val {
  font-size: 14px;
  color: #1F2937;
  font-weight: 500;
  transition: color .4s ease;
}

/* Section title (reused) */
.section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6B7280;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Log table */
.pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pkg-table thead th {
  text-align: left;
  font-size: 10px;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid #E0E0E0;
}
.pkg-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #F0F0F0;
  color: #374151;
  vertical-align: middle;
}
.pkg-table tbody tr { transition: background .3s ease; }
.pkg-table tbody tr:hover { background: #F9FAFB; }
.pkg-table tbody tr.pulse {
  animation: rowPulse 1.4s cubic-bezier(.22,.61,.36,1);
}
@keyframes rowPulse {
  0%   { background: #D9FDD3; }
  50%  { background: #E7F7EE; }
  100% { background: transparent; }
}
.ref { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #6B7280; }
.dept { font-weight: 500; color: #1F2937; }
.when { color: #6B7280; font-size: 12px; }

.badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.b-wait { background: #FEF9E7; color: #7A5700; border-color: #F1E5B4; }
.b-done { background: #E6F4EA; color: #1A6B2E; border-color: #BCE3C8; }
.b-new  { background: #DCF8C6; color: #128C7E; border-color: #C4E8A5; }
.b-late { background: #FDE8E8; color: #B91C1C; border-color: #F5C2C2; }

.footnote {
  margin-top: 2.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #9CA3AF;
}
.page-cta {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #E5E7EB;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.page-cta p {
  font-size: 14px;
  color: #4B5563;
}

/* ── Tweaks panel ─────────────────────────────── */
.tweaks {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  background: #fff;
  border: 1px solid #D0D0D0;
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  font-family: 'Inter', sans-serif;
  z-index: 50;
  animation: twIn .25s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes twIn { from { opacity: 0; transform: translateY(-6px); } }
.tweaks header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #E0E0E0;
  background: #1F2937;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tweaks .tw-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.tw-section {
  padding: 12px 14px;
  border-bottom: 1px solid #F0F0F0;
}
.tw-section:last-child { border-bottom: 0; }
.tw-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6B7280;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tw-row.seg {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tw-seg {
  flex: 1;
  min-width: fit-content;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid #D0D0D0;
  background: #fff;
  color: #374151;
  border-radius: 2px;
  cursor: pointer;
  transition: all .15s ease;
}
.tw-seg:hover { background: #F5F5F5; }
.tw-seg.on {
  background: #1F2937;
  color: #fff;
  border-color: #1F2937;
}
.tw-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}
.tw-toggle input {
  cursor: pointer;
}
.tw-section input[type="range"] {
  width: 100%;
  accent-color: #128C7E;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .phone-col { position: static; height: auto; border-right: 0; border-bottom: 1px solid #E0E0E0; }
  .panel { padding: 2rem 1.5rem; }
  .product-summary { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-topbar {
    padding: .9rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .site-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .site-link,
  .site-cta {
    width: 100%;
    justify-content: center;
  }
  .page-cta {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-cta .site-cta {
    width: 100%;
  }
}
