:root {
  color-scheme: light;
  font: 15px/1.5 Inter, "Segoe UI", Arial, sans-serif;
  --ink: #132d4e;
  --muted: #4d6479;
  --line: #cddae6;
  --blue: #083cbb;
  --light: #edf4fa;
  --orange: #ff8128;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  background: #edf3f8;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; min-height: 44px; padding: 9px 14px; background: white; border: 1px solid var(--line); border-radius: 10px; }
button:disabled { opacity: .55; cursor: default; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid #db640b; outline-offset: 2px; }
a { color: var(--blue); overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-paisaje { display: none; }
#chat {
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  min-width: 0; height: 100vh; height: 100dvh; background: white; overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left));
  background: #102d54; color: white;
}
.brand-mark { display: grid; place-items: center; flex: none; width: 45px; height: 45px; border-radius: 14px 5px 14px 5px; background: white; }
.brand-mark img { width: 35px; height: 35px; object-fit: contain; }
.header-copy { min-width: 0; flex: 1; }
.header-copy h1 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.02em; }
#connection { display: flex; align-items: center; gap: 7px; margin: 4px 0 0; font-size: 12px; line-height: 1.35; color: #d7e6fa; }
#connection::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #edaf76; }
#connection[data-state=online]::before { background: #65dab9; }
.chat-header button, #attach, #record, #send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 50%; }
.chat-header button { border-color: #9cb3cf66; color: white; background: transparent; font-size: 23px; }
.chat-header button:hover { background: #ffffff14; }
.chat-header button svg, #record svg { width: 20px; height: 20px; }
#notice, .quote-context { flex: none; font-size: 13px; }
#notice { padding: 10px 18px; background: #fff3e7; color: #73390d; }
#messages { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; padding: clamp(15px, 3vw, 32px); background: #f5f8fc; }
.welcome { margin: clamp(8px, 5vh, 62px) 0 18px; max-width: 39rem; }
.welcome h2 { max-width: 12ch; margin: 0; font: 400 clamp(36px, 5vw, 58px)/1.04 Georgia, serif; letter-spacing: -.055em; }
.welcome h2::before { display: block; content: ""; height: 4px; width: 29px; margin: 0 0 16px; background: var(--orange); transform: skew(-25deg); }
.welcome > p { margin: 14px 0; max-width: 43ch; color: var(--muted); }
.chat-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.chat-links a, .chat-paisaje a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 15px; border-radius: 24px; font-size: 14px; font-weight: 600; text-decoration: none; }
.chat-links a { color: #234e84; background: white; border: 1px solid #c5d5e6; }
.chat-links a:hover { border-color: #657f9d; }
.privacy { margin-top: 20px; color: var(--muted); font-size: 12px; }
.privacy summary { width: fit-content; max-width: 100%; cursor: pointer; padding-block: 8px; }
.privacy p { margin: 4px 0; max-width: 57ch; }
.message { width: fit-content; max-width: min(87%, 43rem); padding: 11px 15px; margin: 12px 0; background: white; border: 1px solid #d5e0ea; border-radius: 16px 16px 16px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.customer { margin-left: auto; background: #e3edfc; color: #102b50; border-color: #c7d8f0; border-radius: 16px 16px 4px 16px; }
.message p { margin: 0; }
.message small { display: block; text-align: right; color: var(--muted); font-size: 11px; margin-top: 5px; }
.message.pending { opacity: .82; }
.message.failed small, .media-card .media-error { color: #9b3229; }
.load-older { display: block; margin: 0 auto 16px; font-size: 13px; border-radius: 22px; }
#composer { display: flex; flex: none; align-items: flex-end; gap: 7px; padding: 14px max(14px, env(safe-area-inset-right)) calc(14px + var(--safe-bottom)) max(14px, env(safe-area-inset-left)); background: white; border-top: 1px solid var(--line); }
#draft { flex: 1; min-width: 0; padding: 11px 14px; min-height: 46px; max-height: 125px; resize: none; line-height: 22px; font-size: 16px; background: #f6f9fd; border: 1px solid #b4c7db; border-radius: 16px; }
#draft::placeholder { color: #526b83; }
#attach, #record { border: 0; color: #264a77; background: var(--light); font-size: 24px; }
#send, .primary, #voice-stop, .quote-context button { background: var(--blue); border-color: var(--blue); color: white; font-weight: 650; }
#send { font-size: 19px; }
#record[aria-pressed=true] { color: #ab3430; background: #fff0ea; }
#attachment-preview, #voice-status, .quote-context { display: flex; gap: 8px; flex: none; padding: 10px 14px; align-items: center; }
#attachment-preview { overflow: auto; background: #f2f6fb; }
.attachment-chip { display: flex; align-items: center; max-width: 250px; padding-inline: 3px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.attachment-chip button { padding: 5px 8px; background: transparent; border: 0; font-size: 12px; }
.attachment-chip > button:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#voice-status { background: #fff4ed; }
#voice-clock { flex: 1; min-width: 0; font-size: 13px; }
#voice-status button { font-size: 13px; }
.quote-context { flex-wrap: wrap; border-top: 1px solid var(--line); background: #eaf2fc; }
.quote-context a { display: inline-flex; align-items: center; min-height: 36px; font-weight: 600; }
.popover { position: absolute; z-index: 3; left: 12px; width: 320px; max-width: calc(100% - 24px); padding: 8px; overflow-y: auto; overscroll-behavior: contain; background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 12px 40px #17304d28; }
#attachments { bottom: calc(var(--composer-height, 72px) + 8px); max-height: max(44px, calc(100% - var(--composer-height, 72px) - var(--chat-header-height, 71px) - 16px)); }
.popover.top { top: calc(var(--chat-header-height, 71px) + 8px); left: auto; right: 12px; max-height: calc(100% - var(--chat-header-height, 71px) - 16px); }
.menu-title { margin: 5px 8px; color: var(--muted); font-weight: 650; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }
.menu-title:not(:first-child) { border-top: 1px solid var(--line); padding-top: 10px; }
.popover button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; text-align: left; padding: 6px 8px; background: transparent; border: 0; font-size: 14px; }
.popover button:hover { background: var(--light); }
.menu-icon, .media-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; color: #144e98; background: #e8f0fc; }
.menu-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 24px - var(--safe-bottom)); overflow: auto; padding: 22px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 18px; }
dialog::backdrop { background: #0d254bb5; }
dialog h2 { font: 400 29px/1.15 Georgia, serif; letter-spacing: -.04em; margin: 0 0 12px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
dialog input { display: block; width: 100%; padding: 11px; margin: 8px 0; border: 1px solid #a6bbd0; border-radius: 8px; }
dialog input[type=range] { padding: 0; }
#preview-body img, .media-thumbnail { display: block; max-width: 100%; object-fit: contain; border-radius: 8px; }
#preview-body img { max-height: 50vh; margin: auto; }
#preview-body iframe { width: 100%; height: 50vh; border: 0; background: white; }
#preview-body :is(audio, video) { display: block; width: 100%; max-height: 50vh; }
#preview-caption, #crop-controls, #recovery-status, .file-preview { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.file-preview { text-align: center; padding: 12px; }
.file-preview strong { display: block; font-size: 28px; color: var(--blue); }
.media-card { min-width: min(205px, 55vw); margin-top: 6px; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; white-space: normal; }
.message button.media { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: white; }
.media-card button.media { padding: 10px; border: 0; border-radius: 0; }
.media-icon { font-size: 11px; font-weight: 700; }
.media-label { flex: 1; min-width: 0; font-size: 13px; }
.media-label span { display: block; color: var(--muted); font-size: 11px; }
.media-open { color: var(--blue); }
.media-thumbnail { width: 100%; max-height: 250px; }
.message audio { max-width: 100%; width: 230px; }
.message .media-card button.with-image { display: grid; grid-template-columns: 32px 1fr 12px; }
.with-image .media-thumbnail { grid-column: 1/-1; }
@media (min-width: 800px) and (min-height: 540px) {
  .chat-independiente body { display: grid; place-items: center; min-height: 100dvh; padding: clamp(18px, 4vw, 54px); }
  .chat-independiente .chat-page { width: min(100%, 1220px); height: min(820px, calc(100dvh - clamp(36px, 8vw, 108px))); display: grid; grid-template-columns: minmax(235px, .74fr) minmax(0, 1.3fr); overflow: hidden; border: 1px solid #c7d6e4; border-radius: 24px; box-shadow: 0 18px 65px #1a3d6119; }
  .chat-independiente #chat { height: 100%; min-height: 0; }
  .chat-independiente .chat-paisaje { position: relative; display: flex; align-items: end; background: linear-gradient(0deg,#0b274df2 0%,#0b274d42 56%,transparent), url("cartagena-tuviaje.jpg") 46% center / cover; color: white; padding: clamp(22px, 3vw, 47px); }
  .chat-paisaje figure { margin: 0; }
  .chat-paisaje figcaption { font: 400 clamp(38px, 4.2vw, 66px)/1.04 Georgia, serif; letter-spacing: -.055em; }
  .chat-paisaje figcaption small { display: block; margin-bottom: 9px; color: #f0f5ff; font: 600 12px/1.4 Inter, "Segoe UI", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
  .chat-paisaje a { margin-top: 18px; color: white; border: 1px solid #ffffffa6; background: #12345559; }
}
@media (max-width: 480px) {
  .chat-header { gap: 7px; padding-inline: 12px; }
  .header-copy h1 { font-size: 16px; }
  #messages { padding: 16px; }
  .chat-independiente .welcome::before { display: block; content: ""; height: clamp(72px, 14vh, 130px); margin-bottom: 23px; border-radius: 20px 4px 20px 4px; background: url("cartagena-tuviaje.jpg") center 53% / cover; }
  .welcome { margin: 3px 0 12px; }
  #composer { padding-inline: 8px; gap: 4px; }
  .dialog-actions button { flex: 1; }
}
@media (max-height: 560px) { .chat-independiente .welcome::before { display: none; } .welcome { margin-top: 0; } }
