/* wa-ui.css - chat skin (see wa-ui.js). Everything is scoped to html[data-skin="wa"] (the default); "classic" keeps the old look.
   Palette and proportions follow WhatsApp: teal/green accent, white list rows with round avatars, wallpaper behind green
   (mine) and white (theirs) bubbles, yellow system notes, blue double ticks, green pill badges, round + button.
   Colour pairs used for text on a filled colour were checked: white on #008069 5.3:1, #0b141a on #00a884 6.4:1. */

/* ---------- tokens ---------- */
html[data-skin="wa"] {
  --bg: #f0f2f5; --surface: #ffffff; --surface-2: #f0f2f5; --text: #111b21; --muted: #5b6b75; --border: #e3e8eb;
  --accent: #008069; --accent-hover: #006b58; --accent-fg: #ffffff; --accent-soft: #d9fdd3; --info-soft: #e8f1fb;
  --wa-wall: #efeae2; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-ink: #111b21; --wa-sub: #667781; --wa-sys: #fff3c9; --wa-sys-ink: #54656f;
  --wa-tick: #53bdeb; --wa-badge: #008069; --wa-head: #ffffff; --wa-ok-bg: #e2f7e1; --wa-bad-bg: #fde8e6;
  --wa-doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23000' stroke-opacity='.05' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 24h18l8 8v22H20z M38 24v8h8'/%3E%3Ccircle cx='112' cy='30' r='11'/%3E%3Cpath d='M112 24v6l4 3'/%3E%3Cpath d='M30 112l7 7 14-15 M42 119l7 7 14-15'/%3E%3Cpath d='M100 104h26M100 114h26M100 124h16'/%3E%3C/svg%3E");
  --dms-density-tap: 42px; --dms-density-tap-sm: 34px; --dms-density-row: 44px; --dms-density-card: .85rem; --dms-density-gap: .7rem;
  --radius: 14px; --shadow: 0 1px 1px rgba(11, 20, 26, .06);
}
@media (prefers-color-scheme: dark) {
  html[data-skin="wa"]:not([data-theme]) {
    --bg: #0b141a; --surface: #111b21; --surface-2: #202c33; --text: #e9edef; --muted: #8696a0; --border: #222d34;
    --accent: #00a884; --accent-hover: #06cf9c; --accent-fg: #0b141a; --accent-soft: #103d34; --info-soft: #14283a;
    --wa-wall: #0b141a; --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-sys: #182229; --wa-sys-ink: #ffd279;
    --wa-badge: #00a884; --wa-head: #1f2c34; --wa-ok-bg: #123324; --wa-bad-bg: #3a1f1c; --shadow: none;
    --wa-doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23fff' stroke-opacity='.045' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 24h18l8 8v22H20z M38 24v8h8'/%3E%3Ccircle cx='112' cy='30' r='11'/%3E%3Cpath d='M112 24v6l4 3'/%3E%3Cpath d='M30 112l7 7 14-15 M42 119l7 7 14-15'/%3E%3Cpath d='M100 104h26M100 114h26M100 124h16'/%3E%3C/svg%3E");
  }
}
html[data-skin="wa"][data-theme="dark"], html[data-skin="wa"][data-theme="midnight"], html[data-skin="wa"][data-theme="hc-dark"] {
  --bg: #0b141a; --surface: #111b21; --surface-2: #202c33; --text: #e9edef; --muted: #8696a0; --border: #222d34;
  --accent: #00a884; --accent-hover: #06cf9c; --accent-fg: #0b141a; --accent-soft: #103d34; --info-soft: #14283a;
  --wa-wall: #0b141a; --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-sys: #182229; --wa-sys-ink: #ffd279;
  --wa-badge: #00a884; --wa-head: #1f2c34; --wa-ok-bg: #123324; --wa-bad-bg: #3a1f1c; --shadow: none;
  --wa-doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23fff' stroke-opacity='.045' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 24h18l8 8v22H20z M38 24v8h8'/%3E%3Ccircle cx='112' cy='30' r='11'/%3E%3Cpath d='M112 24v6l4 3'/%3E%3Cpath d='M30 112l7 7 14-15 M42 119l7 7 14-15'/%3E%3Cpath d='M100 104h26M100 114h26M100 124h16'/%3E%3C/svg%3E");
}
html[data-skin="wa"][data-theme="midnight"] { --bg: #000; --surface: #0a0f13; --wa-wall: #000; }
html[data-skin="wa"][data-theme="hc-light"], html[data-skin="wa"][data-theme="hc-dark"] { --wa-sub: var(--muted); }
html[data-skin="wa"][data-theme="hc-light"] { --wa-wall: #fff; --wa-doodle: none; }
html[data-skin="wa"][data-wallpaper="plain"] { --wa-doodle: none; }
html[data-skin="wa"] body { background: var(--bg); }
/* zoom lock (feat-w6-zoomlock.js) clips sideways overflow with overflow-x:hidden, which turns <body> into a scroll container
   and silently breaks position:sticky (top bar, thread header, bottom bar). clip hides the same overflow without that side effect. */
@media (max-width: 640px) { html[data-skin="wa"][data-nozoom], html[data-skin="wa"][data-nozoom] body { overflow-x: clip; } }

/* the floating-button spacer of feat-w6-float.js is not needed where the buttons are gone (phone) or where the page ends in a bar */
html[data-skin="wa"] main:has(.wa-thread, .wa-info, .wa-split, .wa-list, .wa-page) { margin-bottom: 0; }
html[data-skin="wa"] { --wa-nl: 36%; }
@media (prefers-color-scheme: dark) { html[data-skin="wa"]:not([data-theme]) { --wa-nl: 70%; } }
html[data-skin="wa"][data-theme="dark"], html[data-skin="wa"][data-theme="midnight"], html[data-skin="wa"][data-theme="hc-dark"] { --wa-nl: 70%; }

/* ---------- controls: smaller, rounder ---------- */
html[data-skin="wa"] .btn, html[data-skin="wa"] button.primary, html[data-skin="wa"] button.ok, html[data-skin="wa"] button.danger,
html[data-skin="wa"] button.small, html[data-skin="wa"] button.big, html[data-skin="wa"] dialog button { border-radius: 999px; }
html[data-skin="wa"] button.big { min-height: 46px; font-size: 1rem; }
html[data-skin="wa"] input, html[data-skin="wa"] select, html[data-skin="wa"] textarea { border-radius: 12px; }
html[data-skin="wa"] dialog { border-radius: 18px; }
html[data-skin="wa"] .card { border-radius: 14px; }
html[data-skin="wa"] .chip { font-size: .74rem; }
html[data-skin="wa"] .wa-i { display: inline-flex; flex: none; vertical-align: middle; }
html[data-skin="wa"] .wa-i svg { display: block; }
.wa-ib { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.wa-ib:hover { background: rgba(127, 127, 127, .14); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
html[data-skin="wa"] .topbar { background: var(--wa-head); border-bottom: 0; box-shadow: 0 1px 0 var(--border); }
html[data-skin="wa"] .brand { color: var(--accent); }
html[data-skin="wa"] .nav a.active { background: var(--accent-soft); color: var(--accent); }
html[data-skin="wa"] .badge { background: var(--wa-badge); color: var(--accent-fg); }
html[data-skin="wa"] .wa-co { display: none; }
@media (max-width: 640px) {
  html[data-skin="wa"] .topbar-inner { height: 48px; }
  html[data-skin="wa"] .brand > span:first-child { display: none; }
  html[data-skin="wa"] .brand > span:last-child { display: block; font-size: 1.3rem; letter-spacing: -.01em; }
  html[data-skin="wa"] .brand > span small { display: none; }
  html[data-skin="wa"] .topbar-inner > select { display: none; }
  html[data-skin="wa"] .wa-co { display: inline-flex; align-items: center; gap: .15rem; min-height: 32px; padding: 0 .6rem; margin-left: .15rem; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); font-size: .85rem; font-weight: 600; order: 2; }
  html[data-skin="wa"].wa-docs-page .w6-searchbtn { display: none; }
  html[data-skin="wa"].wa-thread-page header.topbar, html[data-skin="wa"].wa-info-page header.topbar { display: none; }
  html[data-skin="wa"].wa-thread-page.has-tabbar, html[data-skin="wa"].wa-info-page.has-tabbar { --dms-bottom-offset: 0px; }
  html[data-skin="wa"].wa-thread-page .tabbar, html[data-skin="wa"].wa-info-page .tabbar { display: none; }
  html[data-skin="wa"] main:has(.wa-list, .wa-page, .wa-thread, .wa-info) { padding: 0; max-width: none; }
}

/* ---------- bottom tab bar ---------- */
@media (max-width: 640px) {
  html[data-skin="wa"] .wa-tabbar { background: var(--wa-head); border-top: 1px solid var(--border); }
  html[data-skin="wa"] .wa-tabbar .wa-tab { height: var(--w6-tabbar-h, 58px); gap: 2px; font-size: .75rem; font-weight: 600; color: var(--muted); padding: 6px 2px 4px; }
  html[data-skin="wa"] .wa-tabbar .wa-tab::before { display: none; }
  html[data-skin="wa"] .wa-tab-i { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 30px; border-radius: 16px; transition: background .15s; }
  html[data-skin="wa"] .wa-tab.active { color: var(--text); font-weight: 700; }
  html[data-skin="wa"] .wa-tab.active .wa-tab-i { background: var(--accent-soft); color: var(--accent); }
  html[data-skin="wa"] .wa-tab-i .badge { top: -4px; left: calc(50% + 6px); }
  html[data-skin="wa"] .wa-tl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- chat list ---------- */
.wa-list { background: var(--surface); min-height: calc(100dvh - var(--dms-bottom-offset, 0px) - 48px); padding-bottom: 88px; position: relative; }
.wa-searchbar { display: flex; align-items: center; gap: 4px; padding: 8px 12px 4px; }
.wa-pill { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 24px; background: var(--surface-2); color: var(--muted); flex: 1; min-width: 0; }
.wa-pill input { border: 0; background: transparent; min-height: 40px; padding: 0; color: var(--text); outline: none; box-shadow: none; flex: 1; min-width: 0; border-radius: 0; }
.wa-pill input:focus-visible { outline: none; }
.wa-pill:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.wa-filterbtn { position: relative; color: var(--muted); }
.wa-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.wa-chips { display: flex; gap: 8px; padding: 6px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.wa-chips::-webkit-scrollbar { display: none; }
.wa-chip { flex: none; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.wa-chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 700; }
.wa-rows { display: block; }
.wa-row { display: flex; align-items: center; gap: 14px; padding: 9px 16px; color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.wa-row:hover { background: var(--surface-2); text-decoration: none; }
.wa-row:active, .wa-row.on { background: var(--surface-2); }
.wa-rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-bottom: 9px; margin-bottom: -9px; padding-top: 9px; margin-top: -9px; border-bottom: 1px solid var(--border); }
.wa-row:last-child .wa-rmain { border-bottom-color: transparent; }
.wa-r1, .wa-r2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-rt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.04rem; font-weight: 500; }
.wa-rtime { flex: none; font-size: .75rem; color: var(--muted); }
.wa-rtime.hot { color: var(--accent); font-weight: 600; }
.wa-rsub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.wa-rsub .mono { font-size: .82rem; }
.wa-rflags { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.wa-rflags .chip { font-size: .68rem; padding: .05rem .4rem; }
.wa-draft { color: var(--accent); font-weight: 600; }
.wa-tk { display: inline-flex; vertical-align: -3px; }
.wa-tk.grey { color: var(--muted); } .wa-tk.blue { color: var(--wa-tick); } .wa-tk.red { color: var(--bad); }
.wa-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--wa-badge); color: var(--accent-fg); font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.wa-badge.late { background: var(--bad); color: #fff; }
.wa-flag.bad { width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.wa-av { flex: none; width: 49px; height: 49px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; user-select: none; }
.wa-av.sm { width: 38px; height: 38px; font-size: .7rem; }
.wa-av.xl { width: 96px; height: 96px; font-size: 1.4rem; }
.wa-av.round { border-radius: 50%; }
.wa-empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.wa-empty b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: .3rem; }
.wa-skel { padding: 8px 16px; } .wa-skel i { display: block; height: 49px; margin: 12px 0; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: wa-sh 1.2s linear infinite; }
@keyframes wa-sh { to { background-position: -200% 0; } }
.wa-tail { text-align: center; padding: .6rem; min-height: 8px; }
.wa-count { margin: 0; color: var(--muted); font-size: .85rem; }
.wa-fab { position: fixed; right: 16px; bottom: calc(var(--dms-bottom-offset, 0px) + 16px); z-index: 40; width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-fg); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(11, 20, 26, .3); text-decoration: none; }
.wa-fab:hover { background: var(--accent-hover); text-decoration: none; }
.wa-fab:active { transform: scale(.96); }
.wa-page { background: var(--surface); min-height: calc(100dvh - var(--dms-bottom-offset, 0px) - 48px); }
.wa-pagebar { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.wa-pagebar h1 { margin: 0; font-size: 1.4rem; flex: 1; }
.wa-hintline { margin: 0; padding: 4px 16px 10px; color: var(--muted); font-size: .88rem; }

/* ---------- bottom sheet + menu rows ---------- */
.wa-back { position: fixed; inset: 0; z-index: 8800; background: rgba(11, 20, 26, .5); animation: wa-fade .15s ease-out; }
.wa-sheet { position: fixed; z-index: 8810; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow: auto; overscroll-behavior: contain; background: var(--surface); color: var(--text); border-radius: 20px 20px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 30px rgba(0, 0, 0, .25); animation: wa-up .2s ease-out; transition: transform .18s ease; }
.wa-sheet-h { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 18px 8px 4px 20px; }
.wa-sheet-h b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.wa-sheet-h .wa-x { margin-left: auto; }
.wa-grab { position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border); }
.wa-sheet-b { padding: 4px 8px 4px; }
.wa-sheet.wa-pad .wa-sheet-b { padding: 4px 20px 8px; display: grid; gap: .8rem; }
.wa-mi { display: flex; align-items: center; gap: 18px; width: 100%; min-height: 52px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 1rem; font-weight: 500; text-align: left; justify-content: flex-start; }
.wa-mi:hover { background: var(--surface-2); }
.wa-mi .wa-i { color: var(--muted); width: 24px; }
.wa-mi.danger, .wa-mi.danger .wa-i { color: var(--bad); }
.wa-mi.on { color: var(--accent); font-weight: 700; }
@keyframes wa-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wa-fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 641px) {
  .wa-sheet { left: 50%; right: auto; bottom: auto; top: 14vh; width: min(30rem, 94vw); margin-left: min(-15rem, -47vw); border-radius: 18px; animation: wa-fade .15s ease-out; }
}
html.wa-sheet-open body { overflow: hidden; }
.wa-back.wa-closing { animation: wa-fade-out .18s ease-in forwards; }
.wa-sheet.wa-closing { animation: wa-down .19s ease-in forwards; }
@keyframes wa-fade-out { to { opacity: 0; } }
@keyframes wa-down { to { transform: translateY(100%); opacity: .6; } }
/* first-run pop-ups: one at a time (wa-ui.js queuePopups) and never over the tab bar */
.wa-defer { display: none !important; }
@media (max-width: 640px) { html[data-skin="wa"] .sec-decl { bottom: calc(var(--dms-bottom-offset, 0px) + .6rem); max-height: 70vh; overflow: auto; } }

/* ---------- thread ---------- */
.wa-thread { display: flex; flex-direction: column; min-height: 100dvh; background: var(--wa-wall); }
.wa-th-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 4px 6px 4px 2px; padding-top: calc(4px + env(safe-area-inset-top, 0px)); background: var(--wa-head); box-shadow: 0 1px 0 var(--border); color: var(--text); }
.wa-th-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 2px 4px; border-radius: 10px; }
.wa-th-id:hover { text-decoration: none; }
.wa-th-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.wa-th-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; font-weight: 600; }
.wa-th-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; }
.wa-th-title { flex: 1; font-size: 1.1rem; padding-left: 6px; }
.wa-pin { display: flex; align-items: center; gap: 10px; padding: 7px 14px; background: var(--wa-head); color: var(--text); border-bottom: 1px solid var(--border); text-decoration: none; position: sticky; top: 56px; z-index: 20; }
.wa-pin:hover { text-decoration: none; background: var(--surface-2); }
.wa-pin-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--accent); } .wa-pin-bar.warn { background: #e0a800; }
.wa-pin-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.wa-pin-t b { font-size: .88rem; } .wa-pin-t small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-feed { flex: 1; padding: 8px 10px 16px; background-color: var(--wa-wall); background-image: var(--wa-doodle); background-size: 160px 160px; }
.wa-day { display: flex; justify-content: center; margin: 10px 0 8px; }
.wa-day span { padding: 4px 12px; border-radius: 8px; background: var(--wa-in); color: var(--wa-sys-ink); font-size: .78rem; box-shadow: 0 1px 1px rgba(11, 20, 26, .12); }
.wa-sys { display: flex; justify-content: center; margin: 6px 14px; }
.wa-sys span { display: inline-block; max-width: 92%; padding: 5px 12px; border-radius: 8px; background: var(--wa-sys); color: var(--wa-sys-ink); font-size: .8rem; text-align: center; line-height: 1.35; box-shadow: 0 1px 1px rgba(11, 20, 26, .1); }
.wa-sys.good span { background: var(--wa-ok-bg); color: var(--ok); }
.wa-sys.bad span { background: var(--wa-bad-bg); color: var(--bad); }
.wa-sys a { color: inherit; text-decoration: underline; }
.wa-msg { display: flex; margin: 2px 0; }
.wa-msg.out { justify-content: flex-end; } .wa-msg.in { justify-content: flex-start; }
.wa-bub { position: relative; max-width: min(84%, 520px); padding: 6px 9px 6px; border-radius: 10px; background: var(--wa-in); color: var(--wa-ink); box-shadow: 0 1px 1px rgba(11, 20, 26, .13); font-size: .96rem; line-height: 1.35; word-break: break-word; }
.wa-msg.out .wa-bub { background: var(--wa-out); }
.wa-msg.in .wa-bub.first { border-top-left-radius: 2px; margin-top: 6px; } .wa-msg.out .wa-bub.first { border-top-right-radius: 2px; margin-top: 6px; }
.wa-bub.first::before { content: ""; position: absolute; top: 0; width: 8px; height: 10px; background: inherit; }
.wa-msg.in .wa-bub.first::before { left: -7px; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.wa-msg.out .wa-bub.first::before { right: -7px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.wa-bub.pending { opacity: .85; border: 1px dashed var(--border); box-shadow: none; }
.wa-who { font-size: .8rem; font-weight: 700; margin-bottom: 1px; }
.wa-rev { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wa-cap { margin-top: 4px; white-space: pre-wrap; }
.wa-meta { display: inline-flex; align-items: center; gap: 3px; float: right; margin: 6px 0 -2px 10px; font-size: .68rem; color: var(--wa-sub); line-height: 1; }
.wa-meta .wa-tk { vertical-align: 0; }
.wa-bub::after { content: ""; display: block; clear: both; }
.wa-file { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 2px 0; border-radius: 8px; background: rgba(11, 20, 26, .07); color: inherit; text-decoration: none; min-width: min(230px, 70vw); }
.wa-file:hover { text-decoration: none; background: rgba(11, 20, 26, .11); }
.wa-ext { flex: none; width: 40px; height: 44px; border-radius: 6px; color: #fff; font-size: .62rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.wa-fn { display: flex; flex-direction: column; min-width: 0; } .wa-fn b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wa-fn small { color: var(--wa-sub); font-size: .76rem; }
.wa-dec { font-weight: 700; display: flex; align-items: center; gap: 4px; } .wa-dec.ok { color: var(--ok); } .wa-dec.bad { color: var(--bad); }
.wa-wait { color: var(--wa-sub); display: flex; align-items: center; gap: 4px; font-size: .88rem; } .wa-late { color: var(--bad); font-weight: 700; font-size: .78rem; }

/* ---------- bottom bar (quick replies) ---------- */
.wa-compose { position: sticky; bottom: 0; z-index: 30; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: transparent; }
.wa-compose:not(:has(.wa-cmrow)) { flex-direction: row; align-items: center; }
.wa-cmrow { display: flex; }
.wa-cm { width: 100%; }
.wa-cm.need { box-shadow: inset 0 0 0 2px var(--bad); border-radius: 8px; }
.wa-qr { display: flex; gap: 8px; flex: 1; min-width: 0; }
.wa-qr.scroll { overflow-x: auto; scrollbar-width: none; padding: 2px 1px; } .wa-qr.scroll::-webkit-scrollbar { display: none; }
.wa-qb { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--wa-in); color: var(--accent); font-size: .92rem; font-weight: 600; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 2px rgba(11, 20, 26, .15); }
.wa-qb:hover { text-decoration: none; background: var(--surface-2); }
.wa-qb.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.wa-qb.bad { color: var(--bad); border-color: var(--bad); }
.wa-qb.wide { flex: 1; }
.wa-qr:has(.bad) .wa-qb { flex: 1; }
.wa-plus { flex: none; width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; border: 0; background: var(--wa-in); color: var(--muted); box-shadow: 0 1px 2px rgba(11, 20, 26, .15); }
.wa-compose .wa-pill { background: var(--wa-in); color: var(--wa-ink); box-shadow: 0 1px 2px rgba(11, 20, 26, .15); }
.wa-minfo-sec { display: flex; align-items: center; gap: 6px; margin: 12px 0 4px; color: var(--muted); }
.wa-person { display: flex; align-items: center; gap: 12px; padding: 6px 0; } .wa-person .wa-pn { flex: 1; display: flex; flex-direction: column; } .wa-person small { color: var(--muted); }
.wa-minfo .wa-msg { margin-bottom: 4px; }

/* ---------- document info ---------- */
.wa-info { background: var(--bg); min-height: 100dvh; }
.wa-info .wa-th-head.solid { position: sticky; }
.wa-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px 16px; background: var(--surface); text-align: center; margin-bottom: 8px; }
.wa-hero h2 { margin: 8px 0 0; font-size: 1.3rem; }
.wa-info > .stack { padding: 0 0 24px; max-width: 760px; margin: 0 auto; }
.wa-info .crumbs, .wa-info .pagehead > div:first-child { display: none; }
.wa-info .pagehead { justify-content: center; padding: 0 12px; margin-bottom: 4px; }
.wa-info .card { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
.wa-info .stack > * + * { margin-top: 8px; }
.wa-info .grid.side, .wa-info .grid.two { grid-template-columns: 1fr; gap: 8px; }
.wa-info .grid > .stack > * + * { margin-top: 8px; }

/* ---------- wide: two panes like WhatsApp Web ---------- */
.wa-split { display: grid; grid-template-columns: clamp(330px, 31vw, 450px) 1fr; height: calc(100dvh - var(--wa-top, 100px)); background: var(--surface); }
.wa-side { overflow: auto; border-right: 1px solid var(--border); background: var(--surface); position: relative; }
.wa-main { overflow: auto; position: relative; background: var(--wa-wall); }
.wa-hint { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 4px; padding: 2rem; background: var(--bg); }
.wa-hint-ic { color: var(--border); }
.wa-split .wa-list { min-height: 100%; }
.wa-split .wa-fab { position: absolute; right: 18px; bottom: 18px; position: sticky; float: right; margin: -74px 18px 18px 0; }
.wa-split .wa-thread, .wa-split .wa-info { min-height: 100%; }
.wa-split .wa-th-head, .wa-split .wa-pin { top: 0; }
.wa-split .wa-pin { top: 56px; }
.wa-split .wa-compose { padding-left: 14px; padding-right: 76px; } /* keeps clear of the assistant button */
.wa-split .wa-bub { max-width: min(70%, 560px); }
@media (min-width: 641px) {
  html[data-skin="wa"] .wa-th-head .wa-ib[aria-label="Back"] { display: none; }
  html[data-skin="wa"] .wa-split .wa-info .wa-th-head .wa-ib[aria-label="Back"] { display: inline-flex; }
  html[data-skin="wa"] main:has(.wa-split) { padding: 0; max-width: none; }
}
@media (min-width: 641px) and (max-width: 999px) {
  .wa-list, .wa-page { max-width: 720px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  html[data-skin="wa"] main:has(.wa-list, .wa-page) { padding: 0; max-width: none; }
  html[data-skin="wa"] .wa-th-head .wa-ib[aria-label="Back"] { display: inline-flex; }
  .wa-thread, .wa-info { max-width: 760px; margin: 0 auto; }
  html[data-skin="wa"] main:has(.wa-thread, .wa-info) { padding: 0; max-width: none; }
}
html.wa-wide-split .fb-fab { display: none !important; }
@media (min-width: 1000px) {
  .wa-fab { right: calc(100vw - clamp(330px, 31vw, 450px) + 18px); }
  .wa-split .wa-fab { position: sticky; right: auto; }
}

/* ---------- page change: slide in like a chat opening ---------- */
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .wa-thread, .wa-info { animation: wa-in .2s ease-out; }
  @keyframes wa-in { from { transform: translateX(22px); opacity: .5; } to { transform: none; opacity: 1; } }
}

/* the older "links look clickable" rule (feat-w6-mobile.css) must not underline chat rows, tabs, bubbles or bars */
html[data-skin="wa"] main a.wa-row, html[data-skin="wa"] main a.wa-row *, html[data-skin="wa"] main a.wa-qb, html[data-skin="wa"] main a.wa-file, html[data-skin="wa"] main a.wa-file *,
html[data-skin="wa"] main a.wa-pin, html[data-skin="wa"] main a.wa-pin *, html[data-skin="wa"] main a.wa-th-id, html[data-skin="wa"] main a.wa-th-id *, html[data-skin="wa"] main a.wa-ib,
html[data-skin="wa"] main a.wa-fab, html[data-skin="wa"] .wa-tabbar a { text-decoration: none !important; }
html[data-skin="wa"] main a.wa-row::after, html[data-skin="wa"] main a.wa-qb::after { content: none !important; }

/* ---------- the older pages inherit the chat look ---------- */
html[data-skin="wa"] .tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
html[data-skin="wa"] .chips .on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
html[data-skin="wa"] .timeline > li.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
html[data-skin="wa"] .toast { border-radius: 12px; }
@media print { .wa-tabbar, .wa-fab, .wa-compose, .wa-back, .wa-sheet { display: none !important; } }
