/* WhatsApp message preview. Builds on styles.css and google.css (form rows, buttons, picks, toast). */

.brand-mark.wa { background: #25d366; }
.brand-mark.wa::after { inset: 8px; border-radius: 50% 50% 50% 4px; }

.wa-page .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pick.wide { width: 96px; }
.wa-opt { flex-direction: row; align-items: center; gap: 8px; }
.wa-opt input, .wa-opt select { width: auto; }

.wa-buttons li { grid-template-columns: auto minmax(0, 1fr) auto; }
.wa-buttons .wa-bvalue {
  grid-column: 1 / -1; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; background: var(--surface);
}
.wa-buttons li + li { border-top: 1px dashed var(--border); padding-top: 6px; }

.wa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 360px)); gap: 24px; align-items: start; }
.wa-grid > section { min-width: 0; }

/* ---------- phone (current WhatsApp design, its own colours, not the app theme) ---------- */
.wa-phone {
  --c-bar: #f7f8fa; --c-bar-text: #0b141a; --c-chat: #efe7dd; --c-dot: rgba(0,0,0,.04);
  --c-bubble: #fff; --c-text: #0b141a; --c-sub: #667781; --c-link: #027eb5; --c-line: #e9edef; --c-day: #fff; --c-ph: #d1d7db;
  border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
  font-family: Roboto, -apple-system, "Segoe UI", system-ui, Helvetica, Arial, sans-serif; color: var(--c-text);
}
.wa-phone.dark {
  --c-bar: #111b21; --c-bar-text: #e9edef; --c-chat: #0b141a; --c-dot: rgba(255,255,255,.025);
  --c-bubble: #1f2c34; --c-text: #e9edef; --c-sub: #8696a0; --c-link: #53bdeb; --c-line: #2a3942; --c-day: #182229; --c-ph: #374248;
}

.wa-bar { background: var(--c-bar); color: var(--c-bar-text); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--c-line); }
.wa-back {
  width: 36px; height: 36px; border-radius: 50%; background: var(--c-bubble); display: grid; place-items: center; flex: none;
  font-size: 30px; line-height: 1; padding-bottom: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.wa-av {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: #dfe5e7; color: #54656f; font-weight: 700; font-size: 15px;
}
.wa-av img { width: 100%; height: 100%; object-fit: cover; }
.wa-who { min-width: 0; }
.wa-who b { display: flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-tick { display: inline-grid; flex: none; }
.wa-tick svg { width: 16px; height: 16px; }

.wa-chat {
  background-color: var(--c-chat);
  background-image: radial-gradient(var(--c-dot) 1.2px, transparent 1.3px);
  background-size: 14px 14px;
  padding: 12px 10px 18px; min-height: 420px; display: flex; flex-direction: column; gap: 10px;
}
.wa-day {
  align-self: center; background: var(--c-day); color: var(--c-sub); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 1px .5px rgba(11,20,26,.13);
}

/* Header images show whole, like WhatsApp, up to 4:5 tall. */
.wa-bubble {
  position: relative; align-self: flex-start; width: 80%; max-width: 330px; container-type: inline-size;
  background: var(--c-bubble); border-radius: 18px; padding: 3px 3px 0; box-shadow: 0 1px .5px rgba(11,20,26,.13);
}
.wa-htext { font-weight: 700; font-size: 17px; line-height: 1.35; padding: 6px 9px 0; overflow-wrap: anywhere; }
.wa-media { display: block; width: 100%; border-radius: 6px; object-fit: cover; }
.wa-bubble .wa-media { max-height: 125cqw; }
.wa-bubble > .wa-media:first-child, .wa-bubble > .wa-vid:first-child .wa-media { border-radius: 16px 16px 4px 4px; }
.wa-media.ph { aspect-ratio: 1.91; background: var(--c-ph); color: var(--c-sub); display: grid; place-items: center; font-size: 13px; }
.wa-vid { position: relative; display: grid; place-items: center; }
.wa-vid > .wa-media { grid-area: 1 / 1; }
.wa-vid > .wa-media.ph { background: #3b4a54; }
.wa-vid .play { grid-area: 1 / 1; width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.45); position: relative; }
.wa-vid .play::after { content: ""; position: absolute; left: 18px; top: 13px; border: 10px solid transparent; border-left: 15px solid #fff; border-right: 0; }
.wa-dur {
  position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px; color: #fff; font-size: 11.5px;
  background: rgba(0,0,0,.45); border-radius: 999px; padding: 2px 8px 2px 6px;
}
.wa-dur svg { width: 14px; height: 14px; fill: #fff; }
.wa-doc { display: flex; align-items: center; gap: 10px; background: var(--c-line); border-radius: 15px 15px 6px 6px; padding: 10px; font-size: 14px; overflow-wrap: anywhere; }
.wa-docinfo { min-width: 0; }
.wa-docinfo small { display: block; color: var(--c-sub); font-size: 12px; margin-top: 2px; }
.wa-docicon { flex: none; background: #e2504b; color: #fff; font: 700 10px/1 system-ui, sans-serif; padding: 9px 5px; border-radius: 3px; }

.wa-body { font-size: 16.5px; line-height: 1.32; padding: 7px 10px 0; overflow-wrap: anywhere; }
.wa-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14.5px; }
.wa-body mark.var, .wa-htext mark.var { background: color-mix(in srgb, #f0b400 30%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.wa-foot { color: var(--c-sub); font-size: 14px; padding: 5px 10px 0; overflow-wrap: anywhere; }
.wa-time { color: var(--c-sub); font-size: 11px; text-align: right; padding: 2px 10px 6px; }

.wa-btns { border-top: 1px solid var(--c-line); margin: 0 -3px; }
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; color: var(--c-link); font-size: 16px; font-weight: 500;
}
.wa-btn + .wa-btn { border-top: 1px solid var(--c-line); }
.wa-btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.wa-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wa-sheet { background: var(--c-bubble); border-radius: 16px; margin-top: 6px; box-shadow: 0 1px .5px rgba(11,20,26,.13); overflow: hidden; }
.wa-sheet-title { font-size: 12px; color: var(--c-sub); padding: 10px 14px 4px; text-transform: uppercase; letter-spacing: .05em; }
.wa-sheet .wa-btn { justify-content: flex-start; padding: 11px 14px; }

/* ---------- carousel ---------- */
.wa-carousel {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -10px; padding: 0 10px 4px 10px; scrollbar-width: thin;
}
.wa-card {
  flex: 0 0 76%; scroll-snap-align: start; background: var(--c-bubble); border-radius: 16px; padding: 3px 3px 0;
  box-shadow: 0 1px .5px rgba(11,20,26,.13); display: flex; flex-direction: column;
}
.wa-card .wa-media { aspect-ratio: 1.91; max-height: none; border-radius: 13px 13px 4px 4px; }
.wa-cardbody { font-size: 15.5px; line-height: 1.35; padding: 7px 8px 9px; flex: 1; overflow-wrap: anywhere; }

.wa-cardedit { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.wa-cardedit + .wa-cardedit { margin-top: 10px; }
.wa-cardedit-top { display: flex; justify-content: space-between; align-items: center; }
.wa-cardedit small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.len-note { position: absolute; right: 0; top: 0; font-weight: 500; }
.len-note.over { color: var(--crop); font-weight: 700; }

/* ---------- chat list row and notification ---------- */
.wa-list, .wa-notif {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
}
.wa-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.wa-row .wa-av { width: 48px; height: 48px; font-size: 19px; }
.wa-row-main { flex: 1; min-width: 0; }
.wa-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wa-row-top b { display: flex; align-items: center; gap: 4px; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-row-top small { color: #1fa855; font-size: 12px; flex: none; }
.wa-row-text { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-unread { background: #25d366; color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; display: grid; place-items: center; align-self: flex-end; }

.wa-notif { margin-top: 14px; padding: 12px 14px; font-size: 14px; }
.wa-notif-app { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.wa-notif-icon { width: 14px; height: 14px; border-radius: 4px; background: #25d366; }
.wa-notif-text { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

@media (max-width: 1400px) { .wa-grid { grid-template-columns: repeat(2, minmax(0, 360px)); } }
@media (max-width: 900px) { .wa-grid { grid-template-columns: minmax(0, 400px); } }
