/* WhatsApp tab: chats, the open conversation, and the customer's account.
   One primary action per area; rare actions live in a "⋯" menu. */

.wa-mount { --wa-radius: 16px; --wa-gap: 14px; }

.wa-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

/* Buttons */
.wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1; white-space: nowrap; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.wa-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wa-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wa-btn.is-primary { background: var(--color-accent); color: var(--color-ink-800); }
.wa-btn.is-primary:hover:not(:disabled) { background: var(--color-accent-glow); }
.wa-btn.is-secondary { background: var(--color-paper); color: var(--color-text); border-color: var(--color-line); }
.wa-btn.is-secondary:hover:not(:disabled) { border-color: var(--color-ink-400); }
.wa-btn.is-ghost { background: transparent; color: var(--color-accent); padding: 0 10px; }
.wa-btn.is-ghost:hover:not(:disabled) { background: var(--color-fill-strong); }
.wa-btn.is-danger { background: var(--color-danger); color: #fff; }
.wa-btn.is-danger:hover:not(:disabled) { filter: brightness(0.92); }
.wa-btn.is-small { min-height: 34px; padding: 0 12px; border-radius: 10px; }
.wa-btn.is-block { width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-block: 8px; }

.wa-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border-radius: 10px; border: 0; background: transparent; color: var(--color-text-muted); cursor: pointer; list-style: none; }
.wa-icon-btn::-webkit-details-marker { display: none; }
.wa-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wa-icon-btn:hover { background: var(--color-fill-strong); color: var(--color-text); }

.wa-dot { width: 18px; height: 18px; flex: none; border-radius: 6px; background: #e6efe8 var(--glyph-ok) center / 12px no-repeat; }

/* Global switch: a pill, not a banner */
.wa-global { display: inline-flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-paper); }
.wa-global strong { font-size: var(--text-sm); white-space: nowrap; }
.wa-global.is-paused { border-color: rgba(138, 90, 28, 0.25); background: #fbf7ee; }
.wa-global.is-paused .wa-dot { background: #f6efdf var(--glyph-warn) center / 12px no-repeat; }
.wa-global .wa-btn { border-radius: 999px; }

/* Layout */
.wa-desk { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: var(--wa-gap); align-items: start; }
.wa-desk:has(.wa-account:not([hidden])) { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(260px, 300px); }
.wa-list-pane, .wa-thread, .wa-account, .wa-pick { min-width: 0; border: 1px solid var(--color-line); border-radius: var(--wa-radius); background: var(--color-ink-800); }
.wa-account, .wa-list-pane { overflow-x: hidden; }
.wa-muted { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0; }

/* Chat list */
.wa-list-pane { display: grid; gap: 8px; padding: 10px; max-height: calc(100dvh - 170px); overflow: hidden; grid-template-rows: auto auto auto 1fr auto; }
.wa-find { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-paper); font: inherit; font-size: var(--text-sm); color: var(--color-text); }
.wa-find:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
#wa-list-kind { width: 100%; }
#wa-list-kind button { flex: 1; }
.wa-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; overflow-y: auto; align-content: start; }
.wa-chat { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 10px; text-align: left; font: inherit; color: var(--color-text); background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.wa-chat:hover { background: var(--color-fill); }
.wa-chat.is-on { background: var(--color-paper); border-color: var(--color-line); box-shadow: var(--shadow-dash); }
.wa-chat-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.wa-chat-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wa-chat-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.wa-chat-time { flex: none; font-size: 11px; color: var(--color-text-muted); }
.wa-chat-last { font-size: 13px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wa-tags:empty { display: none; }
.wa-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--color-fill-strong); color: var(--color-text-muted); }
.wa-tag.is-warn { background: var(--color-sand-weak); color: var(--color-warn-ink); }
.wa-tag.is-muted { opacity: 0.75; }
.wa-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--color-accent); color: var(--color-ink-800); font-size: 13px; font-weight: var(--weight-semibold); }

/* Conversation */
.wa-thread { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; min-width: 0; height: calc(100dvh - 170px); min-height: 520px; overflow: hidden; }
.wa-thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.wa-who { flex: 1; min-width: 0; display: grid; gap: 1px; }
.wa-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-who span { font-size: var(--text-xs); color: var(--color-text-muted); }
.wa-back { display: none; }

.wa-state { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-block: 1px solid var(--color-line); background: #f3f7f4; }
.wa-state strong { flex: 1; min-width: 0; font-size: var(--text-sm); }
.wa-state.is-taken, .wa-state.is-paused { background: #fbf7ee; }
.wa-state.is-taken strong, .wa-state.is-paused strong { color: #8a5a1c; }
.wa-state.is-taken .wa-dot, .wa-state.is-paused .wa-dot { background: #f6efdf var(--glyph-warn) center / 12px no-repeat; }

.wa-tabs { display: none; }

/* Fixed rows: the tabs are display:none on desktop and would otherwise give
   their row to the messages, pushing the composer out of the card. */
.wa-messages { grid-row: 4; }
.wa-composer { grid-row: 5; }
.wa-messages { list-style: none; margin: 0; padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; background: var(--color-ink-850); }
.wa-day { align-self: center; margin: 10px 0 4px; padding: 3px 10px; border-radius: 999px; background: var(--color-fill-strong); font-size: 11px; color: var(--color-text-muted); text-transform: capitalize; }
.wa-msg { max-width: min(78%, 560px); padding: 8px 12px 6px; border-radius: 14px; align-self: flex-start; background: var(--color-paper); border: 1px solid var(--color-line); border-bottom-left-radius: 4px; }
.wa-msg p { margin: 0; font-size: var(--text-sm); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-msg-photo { display: block; width: 100%; max-height: 360px; margin-bottom: 4px; object-fit: contain; border-radius: 10px; background: var(--color-fill); cursor: zoom-in; }
.wa-zoom { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(10, 18, 14, 0.82); cursor: zoom-out; }
.wa-zoom[hidden] { display: none; }
.wa-zoom-img { max-width: min(92vw, 1100px); max-height: 92vh; object-fit: contain; border-radius: 12px; background: #fff; cursor: default; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.wa-msg-file { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-accent); }
.wa-msg-voice { display: block; width: min(260px, 100%); height: 36px; }
.wa-msg time { display: block; margin-top: 3px; text-align: right; font-size: 10.5px; color: var(--color-text-faint); }
.wa-msg-who { display: block; margin-bottom: 2px; font-size: 11px; font-weight: var(--weight-semibold); }
.wa-msg.is-roady { align-self: flex-end; background: var(--color-moss-weak); border-color: transparent; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.wa-msg.is-roady .wa-msg-who { color: var(--color-moss); }
.wa-msg.is-equipo { align-self: flex-end; background: var(--color-accent); border-color: transparent; color: var(--color-ink-800); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.wa-msg.is-note p { color: var(--color-text-muted); font-style: italic; }
/* Internal note: a team-only card across the thread, never a chat bubble. */
.wa-msg.is-nota { align-self: center; width: min(92%, 600px); max-width: none; border: 1px dashed color-mix(in srgb, var(--color-warn) 55%, transparent); border-radius: 12px; background: var(--color-sand-weak); }
.wa-msg.is-nota .wa-msg-who { display: flex; align-items: center; gap: 5px; color: var(--color-warn-ink); }
.wa-msg.is-nota .wa-msg-who svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.wa-composer { display: grid; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--color-line); background: var(--color-ink-800); }
.wa-composer textarea { width: 100%; min-height: 64px; max-height: 220px; resize: vertical; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-paper); font: inherit; font-size: var(--text-sm); line-height: 1.45; color: var(--color-text); }
.wa-composer textarea:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.wa-composer textarea:disabled { background: var(--color-fill); }
.wa-composer-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.wa-hint { flex: 1; font-size: var(--text-xs); color: var(--color-text-muted); }
.wa-hint:empty { display: none; }
.wa-composer.is-blocked .wa-hint { color: var(--color-warn-ink); }

/* Reply or internal note: the switch names who reads it, and a note turns
   the whole composer sand so it never passes for a reply. */
.wa-mode { display: flex; gap: 4px; padding: 3px; border-radius: 11px; background: var(--color-fill-strong); justify-self: start; }
.wa-mode button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: var(--weight-semibold); color: var(--color-text-muted); cursor: pointer; }
.wa-mode button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wa-mode button[aria-checked="true"] { background: var(--color-paper); color: var(--color-text); box-shadow: var(--shadow-dash); }
.wa-mode button[data-wa-mode="note"][aria-checked="true"] { color: var(--color-warn-ink); }
.wa-composer.is-note { background: var(--color-sand-weak); border-top-color: color-mix(in srgb, var(--color-warn) 45%, transparent); }
.wa-composer.is-note textarea { border-color: color-mix(in srgb, var(--color-warn) 45%, transparent); background: #fffdf7; }
.wa-composer.is-note textarea:focus { outline-color: var(--color-warn); }
.wa-composer.is-note .wa-hint { color: var(--color-warn-ink); font-weight: var(--weight-semibold); }
.wa-composer.is-note #wa-attach, .wa-composer.is-note .wa-attached { display: none; }
.wa-composer.is-note #wa-send-button { background: var(--color-warn-ink); color: #fff; }
.wa-composer.is-note #wa-send-button:hover:not(:disabled) { filter: brightness(1.1); }
#wa-send-button .wa-note-icon, .wa-composer.is-note #wa-send-button .wa-send-icon { display: none; }
.wa-composer.is-note #wa-send-button .wa-note-icon { display: block; }
#wa-reopen[hidden] { display: none; }
.wa-btn.is-icon { width: 40px; padding: 0; margin-right: auto; background: var(--color-paper); color: var(--color-text); border-color: var(--color-line); }
.wa-btn.is-icon:hover:not(:disabled) { border-color: var(--color-ink-400); }
.wa-btn.is-icon svg { width: 18px; height: 18px; }
.wa-attached { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-paper); font-size: var(--text-sm); }
.wa-attached[hidden], .wa-attached-thumb[hidden] { display: none; }
.wa-attached-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.wa-attached-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-attached-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--color-text-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.wa-attached-x:hover { background: var(--color-fill-strong); }

/* Customer account */
.wa-account { display: grid; gap: 16px; align-content: start; padding: 14px; max-height: calc(100dvh - 170px); overflow-y: auto; transition: opacity 0.15s ease; }
.wa-account.is-loading { opacity: 0.6; }
.wa-acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wa-acc-head > div { display: grid; gap: 2px; min-width: 0; }
.wa-acc-head strong { font-size: var(--text-md); }
.wa-acc-head span { font-size: var(--text-xs); color: var(--color-text-muted); }
.wa-acc-sec { display: grid; gap: 6px; min-width: 0; }
.wa-acc-sec h3 { margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.wa-sec-head { display: flex; justify-content: space-between; align-items: center; }
.wa-sec-head .wa-icon-btn { width: 28px; height: 28px; }

.wa-due { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wa-due:empty { display: none; }
.wa-due-item { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: var(--color-sand-weak); border: 1px solid color-mix(in srgb, var(--color-warn) 35%, transparent); }
.wa-due-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wa-due-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-warn-ink); }
.wa-due-amount { font-size: var(--text-lg); color: var(--color-text); }
.wa-due-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.wa-due-item .wa-btn { margin-top: 6px; }

.wa-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-paper); overflow: hidden; }
.wa-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 6px 6px 6px 12px; }
.wa-row + .wa-row { border-top: 1px solid var(--color-line); }
.wa-row.is-empty { padding: 12px; font-size: var(--text-sm); color: var(--color-text-muted); }
.wa-row-main { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-row-day { flex: none; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.wa-row-sub { flex: 1 1 auto; min-width: 0; font-size: var(--text-xs); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-row-side { display: flex; align-items: center; gap: 2px; flex: none; }
.wa-plate-chip { flex: none; padding: 3px 8px; border-radius: 6px; border: 1.5px solid var(--color-text); background: #fff; color: var(--color-text); font-family: var(--font-mono); font-size: 12px; font-weight: var(--weight-semibold); letter-spacing: 0.06em; }
.wa-plate-chip.is-mini { padding: 0 6px; border-width: 1px; border-radius: 5px; font-size: 10.5px; line-height: 16px; }
button.wa-plate-chip { cursor: pointer; }
button.wa-plate-chip:hover { background: var(--color-fill); }
button.wa-row-main { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.wa-row-main:hover .wa-row-day { text-decoration: underline; text-underline-offset: 2px; }
.wa-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: var(--weight-semibold); }
.wa-badge.is-ok { background: var(--color-moss-weak); color: var(--color-moss); }
.wa-badge.is-due { background: var(--color-sand-weak); color: var(--color-warn-ink); }
.wa-badge.is-none { background: var(--color-fill); color: var(--color-text-muted); font-weight: var(--weight-regular); }
#wa-stays-more { justify-self: start; }

.wa-menu { position: relative; flex: none; }
.wa-menu[open] > summary { background: var(--color-fill-strong); color: var(--color-text); }
.wa-menu-list { position: fixed; z-index: 75; min-width: 200px; max-width: calc(100vw - 16px); display: grid; padding: 6px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-paper); box-shadow: 0 12px 32px rgba(18, 36, 28, 0.16); }
.wa-menu-list button { padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: var(--text-sm); text-align: left; color: var(--color-text); cursor: pointer; }
.wa-menu-list button:hover { background: var(--color-fill); }
.wa-menu-list button.is-danger { color: var(--color-danger); }
.wa-menu-list button[hidden] { display: none; }

.wa-add-plate { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--color-line); background: var(--color-paper); }
.wa-input { width: 100%; min-width: 0; min-height: 36px; padding: 0 10px; border: 1px solid var(--color-line); border-radius: 9px; background: #fff; font: inherit; font-size: var(--text-sm); }
.wa-input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.wa-add-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }

.wa-pick { display: grid; place-items: center; gap: 10px; min-height: 360px; padding: 32px; text-align: center; color: var(--color-text-muted); }
.wa-pick svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.5; }
.wa-pick p { max-width: 26ch; margin: 0; font-size: var(--text-sm); }

.wa-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); max-width: min(92vw, 420px); padding: 11px 16px; border-radius: 12px; background: var(--color-text); color: var(--color-ink-800); font-size: var(--text-sm); box-shadow: 0 12px 32px rgba(18, 36, 28, 0.25); }

.wa-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100dvh - 32px); width: min(92vw, 400px); padding: 22px; border: 0; border-radius: 18px; background: var(--color-ink-800); color: var(--color-text); box-shadow: 0 24px 60px rgba(18, 36, 28, 0.3); }
.wa-dialog::backdrop { background: rgba(18, 36, 28, 0.42); }
.wa-dialog h2 { margin: 0 0 8px; font-size: var(--text-lg); letter-spacing: -0.01em; }
.wa-dialog p { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--color-text-muted); }
.wa-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 1180px) {
  .wa-desk:has(.wa-account:not([hidden])) { grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); }
  .wa-account { grid-column: 2; max-height: none; }
}

/* Phone: the list is the page; an open chat fills the screen like WhatsApp,
   sized by whatsapp.js to what the keyboard leaves (--wa-view-h). The
   .dash.is-signed-in prefix outranks the card rules in porcelain.css. */
@media (max-width: 760px) {
  .wa-desk, .wa-desk:has(.wa-account:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .wa-list-pane { max-height: none; }
  .wa-pick { display: none; }
  .wa-find, .wa-input, .wa-composer textarea { font-size: 16px; }
  .wa-chat { padding: 11px 10px; }
  .wa-account { grid-column: auto; max-height: none; }
  .wa-desk[data-wa-pane="chat"] .wa-account { display: none; }

  .wa-reading .wa-list-pane { display: none; }
  .dash.is-signed-in.wa-reading .shell:has(.view:not([hidden]) .wa-desk) { z-index: 50; }
  .wa-reading .wa-desk { position: fixed; inset: var(--wa-view-top, 0px) 0 auto; z-index: 70; height: var(--wa-view-h, 100dvh); display: flex; flex-direction: column; align-items: stretch; gap: 0; background: var(--color-ink-800); }
  .dash.is-signed-in.wa-reading .wa-thread,
  .dash.is-signed-in.wa-reading .wa-account { border: 0; border-radius: 0; box-shadow: none; }
  .dash.is-signed-in.wa-reading .wa-thread { flex: 1 1 auto; height: auto; min-height: 0; }
  .dash.is-signed-in.wa-reading .wa-desk[data-wa-pane="account"] .wa-thread { flex: none; grid-template-rows: auto auto auto; }
  .wa-desk[data-wa-pane="account"] .wa-messages, .wa-desk[data-wa-pane="account"] .wa-composer { display: none; }
  .dash.is-signed-in.wa-reading .wa-desk[data-wa-pane="account"] .wa-account { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(20px + env(safe-area-inset-bottom)); background: var(--color-ink-850); }

  .wa-back { display: inline-grid; width: 40px; height: 40px; }
  .wa-thread-head { gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 6px 6px 4px; }
  .wa-thread-head .wa-avatar { width: 34px; height: 34px; }
  .wa-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #wa-share { width: 40px; height: 40px; }
  .wa-state { padding: 6px 8px 6px 12px; }
  .wa-state strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

  .wa-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 6px; gap: 4px; border-bottom: 1px solid var(--color-line); }
  .wa-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); cursor: pointer; }
  .wa-tabs button[aria-selected="true"] { background: var(--color-paper); color: var(--color-text); box-shadow: var(--shadow-dash); }
  .wa-tab-due { min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--color-sand-weak); color: var(--color-warn-ink); font-size: 11px; line-height: 16px; }
  .wa-tab-due[hidden] { display: none; }

  .wa-messages { padding: 12px 10px; overscroll-behavior: contain; }
  .wa-msg { max-width: 86%; }
  .wa-thread-loading { align-self: center; margin: auto 0; }

  /* Composer: clip, a box that grows with the message, and send, in one row. */
  .wa-composer { grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "mode mode mode" "attached attached attached" "note note note" "reopen reopen reopen" "attach text send"; gap: 0 6px; align-items: end; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .wa-mode { grid-area: mode; margin-bottom: 6px; }
  .wa-composer.is-note textarea { grid-column: attach / text; }
  .wa-composer-bar { display: contents; }
  .wa-composer textarea { grid-area: text; height: 44px; min-height: 44px; max-height: 132px; resize: none; padding: 10px 12px; }
  .wa-attached { grid-area: attached; margin-bottom: 6px; }
  .wa-hint { grid-area: note; margin: 0 4px 6px; }
  #wa-reopen { grid-area: reopen; width: 100%; margin-bottom: 6px; }
  #wa-attach { grid-area: attach; width: 44px; min-height: 44px; margin: 0; }
  #wa-send-button { grid-area: send; width: 44px; min-height: 44px; padding: 0; }
  #wa-send-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  .dash.wa-reading .wa-toast { top: calc(var(--wa-view-top, 0px) + env(safe-area-inset-top) + 64px); bottom: auto; z-index: 80; }
  .wa-reading #wa-error:not([hidden]) { position: fixed; z-index: 80; top: calc(var(--wa-view-top, 0px) + env(safe-area-inset-top) + 64px); left: 10px; right: 10px; margin: 0; padding: 10px 12px; border-radius: 12px; background: #fdf1ec; box-shadow: 0 12px 32px rgba(18, 36, 28, 0.16); cursor: pointer; }
}
