/* Colores tomados del Instagram @mardelaspampas: pino del bosque, arena y el verde de sus placas */
:root {
  --leaf: #8cc252;
  --leaf-deep: #3f7a26;
  --leaf-wash: #e3efd3;
  --ink: #1a2a20;
  --ink-2: #4f5d55;
  --pine: #1e3a2b;
  --paper: #f4efe5;
  --chat-bg: #e8e1d2;
  --card: #fffdf8;
  --line: #ddd4c3;
  --pa: #2d6a3e;
  --pa-wash: #dcefe0;
  --tu: #1f5f86;
  --tu-wash: #dbeaf3;
  --du: #6b625a;
  --du-wash: #ece7e1;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(30, 48, 34, .28);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: #cfc6b3;
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--leaf); color: var(--ink); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--leaf-deep); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.shell {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}
@media (min-width: 700px) and (min-height: 700px) {
  body { display: grid; place-items: center; padding: 24px; }
  .shell { height: min(880px, calc(100dvh - 48px)); border-radius: 28px; box-shadow: 0 40px 80px -30px rgba(30, 48, 34, .45); }
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px;
  border: 0; border-radius: 12px;
  font: 650 16px/1 var(--body);
  text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--leaf); color: var(--ink); box-shadow: 0 8px 18px -10px rgba(63, 122, 38, .8); }
.btn--primary:hover { background: #9bcd62; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.btn--block { width: 100%; }
.iconbtn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:active { background: rgba(255,255,255,.12); }
.linkbtn { border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 12px 0; font-size: 14px; }

/* Entrada */
.intro { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.intro__photo { position: relative; margin: 0; aspect-ratio: 4 / 3.1; max-height: 46dvh; width: 100%; overflow: hidden; }
.intro__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; animation: settle 1.6s var(--ease) both; }
.intro__photo::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(to top, var(--paper), rgba(244,239,229,0)); }
.intro__photo figcaption { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 4px 9px; border-radius: 999px; background: rgba(20,36,26,.62); color: #fff; font-size: 11.5px; letter-spacing: .01em; }
@keyframes settle { from { transform: scale(1.08); } to { transform: scale(1); } }

.intro__body { position: relative; padding: 0 20px 28px; margin-top: -28px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 15px/1.2 var(--display);  }
.brand small { display: block; font: 500 13px/1.3 var(--body); color: var(--ink-2); }
.brand img { border-radius: 50%; box-shadow: var(--shadow); }
.intro h1 {
  margin: 18px 0 12px;
  font: 850 clamp(34px, 10.4vw, 46px)/1 var(--display);
  
  letter-spacing: -.025em;
  text-wrap: balance;
}
.intro__lead { margin: 0 0 18px; color: var(--ink-2); font-size: 16.5px; max-width: 36ch; }
.does { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.does li { display: flex; gap: 10px; align-items: flex-start; font-weight: 550; line-height: 1.35; }
.does svg { color: var(--leaf-deep); margin-top: 1px; stroke-width: 2.4; }
.intro__note { margin: 14px 0 0; font-size: 13px; color: var(--ink-2); text-align: center; }

/* App */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar { flex: none; padding: 10px 12px 8px; background: var(--pine); padding-top: max(10px, env(safe-area-inset-top)); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.08); }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; border: 0; border-radius: 9px; background: transparent;
  color: #cfdccf; font-weight: 600; font-size: 15px;
  transition: background-color .25s var(--ease), color .25s;
}
.tab[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--leaf); color: var(--ink); font-size: 12.5px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.chathead { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 6px 10px 14px; background: var(--pine); color: #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; }
.chathead__who { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.chathead__who strong { font-size: 15.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chathead__who span { font-size: 12.5px; color: #b9cdbb; }
.sim-pill { flex: none; padding: 4px 8px; border-radius: 6px; background: var(--leaf); color: var(--ink); font: 750 11px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; }

.messages {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 12px 10px;
  background: var(--chat-bg);
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin; scrollbar-color: #c2bba8 transparent;
}
.daystamp { align-self: center; margin: 2px 0 8px; padding: 4px 10px; border-radius: 8px; background: rgba(255,253,250,.8); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.notice { align-self: center; max-width: 88%; margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: #f3ecd9; color: #5b5233; font-size: 12.5px; text-align: center; line-height: 1.4; }

.msg {
  position: relative; max-width: 84%;
  padding: 8px 11px 6px; border-radius: 12px;
  font-size: 15.5px; line-height: 1.42;
  box-shadow: 0 1px 1px rgba(30, 48, 34, .1);
  animation: pop .38s var(--ease) both;
  overflow-wrap: anywhere;
}
.msg--bot { align-self: flex-start; background: var(--card); border-top-left-radius: 4px; }
.msg--me { align-self: flex-end; background: var(--leaf-wash); border-top-right-radius: 4px; }
.msg + .msg--bot.cont, .msg--me + .msg--me { margin-top: -2px; }
.msg p { margin: 0; }
.msg p + p { margin-top: 6px; }
.msg b { font-weight: 650; }
.meta { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 2px; font-size: 11px; color: #7c857e; font-variant-numeric: tabular-nums; }
.meta svg { width: 16px; height: 16px; color: #3f8fb8; stroke-width: 2; }
.msg--photo { padding: 4px 4px 6px; width: 76%; }
.msg--photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 9px; }
.msg--photo .cap { padding: 6px 7px 0; font-size: 13.5px; color: var(--ink-2); }
.msg--photo .meta { padding-right: 6px; }
.tag-ejemplo { display: inline-block; padding: 1px 6px; margin-left: 4px; border-radius: 5px; background: var(--du-wash); color: var(--du); font-size: 11px; font-weight: 650; vertical-align: 1px; }
.src { display: block; margin-top: 4px; font-size: 12px; color: #7c857e; }

.typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 14px; border-radius: 12px; border-top-left-radius: 4px; background: var(--card); animation: pop .3s var(--ease) both; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa39c; animation: dot 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

.handoff {
  align-self: stretch; margin: 10px 2px 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; border: 0; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 650; font-size: 15px;
  animation: pop .45s var(--ease) both;
}
.handoff svg { color: var(--leaf); }

.composer { flex: none; background: var(--chat-bg); padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 2px 2px 10px; }
.quick:empty { display: none; }
.qr {
  min-height: 42px; padding: 0 15px; border-radius: 21px;
  border: 1.5px solid var(--leaf-deep); background: var(--card); color: var(--leaf-deep);
  font-weight: 650; font-size: 14.5px;
  animation: pop .35s var(--ease) both;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, transform .15s var(--ease);
}
.qr:active { transform: scale(.96); background: var(--leaf); color: var(--ink); border-color: var(--leaf); }
.inputbar { display: flex; gap: 8px; align-items: center; }
.inputbar input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px;
  border: 0; border-radius: 24px; background: var(--card);
  font: 400 16px var(--body); color: var(--ink);
  caret-color: var(--leaf-deep);
  box-shadow: 0 1px 1px rgba(30, 48, 34, .1);
}
.inputbar input::placeholder { color: #76807a; }
.inputbar input:focus { outline: 2px solid var(--leaf); outline-offset: 0; }
.send { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: var(--ink); color: var(--leaf); display: grid; place-items: center; transition: transform .15s var(--ease), opacity .2s; }
.send:active { transform: scale(.92); }
.send:disabled { opacity: .45; }
.send svg { width: 21px; height: 21px; fill: currentColor; stroke-width: 1.5; }

/* Tablero */
.board { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 16px 32px; }
.board h2, .summary h2 { margin: 0 0 6px; font: 820 28px/1.05 var(--display);  letter-spacing: -.02em; text-wrap: balance; }
.board__sub { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 14px; padding-inline: 16px; scrollbar-width: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lead { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(30,48,34,.08), 0 6px 18px -12px rgba(30,48,34,.3); overflow: hidden; animation: pop .4s var(--ease) both; }
.lead > button { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; width: 100%; padding: 14px 14px 13px; border: 0; background: none; text-align: left; }
.lead__name { font-weight: 700; font-size: 16px; }
.lead__time { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; align-self: center; }
.lead__line { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.lead__top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.lead__body { padding: 0 14px 14px; }
.lead[aria-expanded="false"] .lead__body { display: none; }
.lead__body .ficha { box-shadow: none; padding: 0; background: none; }
.lead__body .btn { margin-top: 12px; min-height: 46px; font-size: 15px; }

.prio { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.prio--pauta { background: var(--pa-wash); color: var(--pa); }
.prio--turista { background: var(--tu-wash); color: var(--tu); }
.prio--duda { background: var(--du-wash); color: var(--du); }

.empty { padding: 26px 18px; border-radius: var(--radius); background: rgba(255,253,250,.6); text-align: center; color: var(--ink-2); }
.empty p { margin: 0 0 14px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* Resumen */
.summary { position: absolute; inset: 0; z-index: 5; background: var(--paper); overflow-y: auto; overscroll-behavior: contain; animation: rise .5s var(--ease) both; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.summary__inner { padding: max(10px, env(safe-area-inset-top)) 16px 28px; display: grid; gap: 14px; }
.summary__close { margin-left: -8px; }
.summary h2 { margin: 0; }
.summary__sub { margin: -6px 0 2px; color: var(--ink-2); font-size: 15px; }
.summary__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary__row .btn { padding: 0 10px; font-size: 14.5px; min-height: 48px; text-align: center; line-height: 1.15; }

.ficha { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.ficha__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ficha__head h3 { margin: 0; font: 780 21px/1.15 var(--display);  letter-spacing: -.01em; }
.ficha__brief { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: 14.5px; line-height: 1.45; }
.ficha dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.ficha dt, .ficha dd { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ficha dt { color: var(--ink-2); padding-right: 14px; }
.ficha dd { margin: 0; font-weight: 600; text-align: right; }
.ficha__foot { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }

@media (max-width: 370px) {
  .msg { font-size: 15px; }
  .qr { padding: 0 13px; font-size: 14px; }
  .summary__row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.flag { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.state { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 650; color: var(--ink-2); }
.intro h1 { font-weight: 800; letter-spacing: -.035em; }
