/* WhatsApp inbox page (wa-inbox-ui.js). Theme variables only, so every colour palette and dark mode work. Loaded after testimonials.css. */
.wi-page { padding-bottom: 16px; }
.wi-lead { max-width: 70ch; margin-top: 2px; }
.wi-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 12px 0 14px; }
.wi-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.wi-tab { appearance: none; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; padding: 8px 16px; min-height: 38px; border-radius: 999px; border: 1px solid var(--field-line, var(--line)); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.wi-tab:hover { background: var(--surface-2); }
.wi-tab.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.wi-tab:focus-visible, .wi-seg button:focus-visible, .wi-thumb:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wi-tab-n { font-size: 12px; font-weight: 800; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); text-align: center; }
.wi-tab.on .wi-tab-n { background: rgba(255,255,255,.2); color: inherit; }
.wi-chipbar { margin-bottom: 14px; }
.wi-banner { padding: 11px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 12px; line-height: 1.5; }
.wi-banner.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.wi-banner .dc-link { color: inherit; text-decoration: underline; margin-left: 4px; }
.wi-note { margin: 0 0 12px; max-width: 75ch; }
.wi-list { display: flex; flex-direction: column; gap: 14px; }
.wi-empty { padding: 34px 14px; text-align: center; }
.wi-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-1); min-width: 0; }
.wi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; }
.wi-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wi-name { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.wi-sub { font-size: 12.5px; color: var(--muted); }
.wi-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wi-seg { display: inline-flex; border: 1px solid var(--field-line, var(--line)); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.wi-seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 6px 14px; min-height: 32px; cursor: pointer; }
.wi-seg button.on { background: var(--ink); color: var(--surface); }
.wi-seg button:disabled { cursor: default; }
.wi-flag { margin-top: 12px; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.wi-flag.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.wi-flag.dup { background: var(--violet-bg); border-color: transparent; color: var(--violet); }
.wi-flag.info { background: var(--blue-bg); border-color: transparent; color: var(--blue); }
.wi-flag .dc-link { color: inherit; text-decoration: underline; }
.wi-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.wi-thumb { flex: 0 0 auto; width: 104px; height: 78px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-3); overflow: hidden; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-decoration: none; font: inherit; font-size: 11.5px; font-weight: 700; position: relative; }
.wi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wi-thumb.is-video { background: var(--obsidian-2); color: #F3EBDD; border-color: var(--obsidian-line); }
.wi-thumb.is-link span { text-decoration: underline; }
.wi-thumb.is-empty { cursor: default; border-style: dashed; }
.wi-nomedia { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.wi-summary { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.wi-ai { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold-soft); border-radius: 999px; padding: 2px 8px; margin-right: 6px; vertical-align: 1px; }
.wi-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.wi-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px 14px; margin-top: 14px; }
.wi-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wi-f label { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.wi-f input, .wi-f select { width: 100%; box-sizing: border-box; padding: 9px 11px; min-height: 40px; border-radius: 10px; border: 1px solid var(--field-line, var(--line)); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.wi-f input:focus, .wi-f select:focus, .wi-page textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.22); outline: none; }
.wi-f.is-missing input, .wi-f.is-missing select { border-color: var(--warn-border); background: var(--warn-bg); }
.wi-f.is-edited input, .wi-f.is-edited select { border-left: 3px solid var(--gold); }
.wi-fields[data-readonly] input, .wi-fields[data-readonly] select { pointer-events: none; opacity: .8; }
.wi-undo { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-size: 11px; font-weight: 700; color: var(--gold-ink); text-decoration: underline; cursor: pointer; }
.wi-msgs { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.wi-msgs summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink); }
.wi-msglist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wi-msglist li { padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); min-width: 0; }
.wi-msg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.wi-msg-time { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.wi-why { font-size: 11.5px; color: var(--amber); font-weight: 700; }
.wi-msg-text { margin-top: 3px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.wi-msg-media { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.wi-inline { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin-top: 4px; }
.wi-split { font-size: 12px; }
.wi-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.wi-state { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); min-width: 0; flex: 1 1 220px; }
.wi-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wi-actions .btn { min-height: 40px; }
.wi-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px 16px; margin: 12px 0 0; }
.wi-dl > div { min-width: 0; }
.wi-dl dt { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wi-dl dd { margin: 2px 0 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.wi-dl-wide { grid-column: 1 / -1; }
.wi-settings { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.wi-set .dc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.wi-form { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.wi-form .field input[type="text"], .wi-form .field input[type="number"], .wi-form textarea { width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--field-line, var(--line)); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.wi-form .field input[type="number"] { max-width: 160px; }
.wi-check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); min-height: 32px; }
.wi-check input { width: 18px; height: 18px; accent-color: var(--gold-2); }
.wi-rules { margin: 8px 0 0; padding-left: 18px; line-height: 1.55; }
.wi-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.wi-person { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; min-height: 44px; }
.wi-person input { width: 18px; height: 18px; accent-color: var(--gold-2); flex: none; }
.wi-person span { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.wi-person small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.wi-savebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wi-savebar .btn { min-height: 42px; }
.wi-testres.good, #wi-saveres.good { color: var(--green); } .wi-testres.bad, #wi-saveres.bad { color: var(--red); }
.wi-hook { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 10px 0; }
.wi-hook code { flex: 1 1 260px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-3); color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; }
.wi-recent { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.wi-recent li { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--text); }
.wi-recent li:first-child { border-top: 0; }
.wi-target { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: var(--surface-2); }
.wi-target input { margin-top: 4px; accent-color: var(--gold-2); }
.wi-targets { max-height: 46vh; overflow-y: auto; margin-top: 10px; }
.wi-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.wi-modal-actions .btn { min-height: 42px; }
.wi-viewer { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.wi-viewer img, .wi-viewer video { max-width: 100%; max-height: 68vh; border-radius: 12px; background: var(--surface-3); }
.wi-origin { margin: 10px 0 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wi-tag { background: var(--green-bg); color: var(--green); }
.wi-pointer { display: flex; gap: 10px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--gold-wash); border: 1px solid var(--gold-line); color: var(--ink); font-size: 14px; }
@media (max-width: 640px) {
  .wi-card { padding: 14px; border-radius: 16px; }
  .wi-tabs { width: 100%; } .wi-tab { flex: 1 1 auto; justify-content: center; padding: 8px 10px; }
  .wi-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wi-actions { width: 100%; } .wi-actions .btn { flex: 1 1 calc(50% - 8px); }
  .wi-thumb { width: 92px; height: 70px; }
  .wi-seg button { padding: 6px 12px; }
}
@media (max-width: 380px) { .wi-fields { grid-template-columns: minmax(0, 1fr); } }

/* Update 104: the two reminder lines at the top of the Dashboard (unknown WhatsApp numbers waiting; the server's disk nearly full) */
.dash-alert-slot:empty { display: none; }
.dash-alert-slot { display: grid; gap: 8px; margin: 0 0 14px; }
.dash-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.dash-alert .dash-alert-text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.dash-alert.is-danger { background: rgba(225, 74, 74, .08); border-color: rgba(225, 74, 74, .45); color: var(--ink); }
.dash-alert.is-danger b { color: var(--brand-red, #C0392B); }
/* Update 106: in the dark Forest and Sand colours the red words were a shade too faint on the dark background (contrast 4.47, needs 4.5):
   a touch brighter red there (about 5 to 1 on every dark surface of those two). */
body[data-palette="forest"][data-theme="dark"] .dash-alert.is-danger b, body[data-palette="sand"][data-theme="dark"] .dash-alert.is-danger b { color: #F06A6A; }
.chat-doc { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; overflow-wrap: anywhere; }
