/* css/texts-panel.css — Texts panel (2026-11-16, "Option C").
   2026-11-16 (Mark): same look as the Taylor window ("Window look C" in
   js/shared/taylor-widget.js): a floating rounded card under the top bar,
   see-through blurred light header with round icon buttons (back or new
   text on the left, minimize and close on the right) and a centered
   name with a status dot, a light conversation area, coral bubbles for what
   the agent sent and white cards for replies, times between messages, and a
   pill message box with a round coral send button. Keep the two in step. */

/* ── top-bar button ───────────────────────────────────────────── */
.texts-topbar-btn {
  position: relative;
  width: 32px; height: 32px;                 /* same height as Ask Taylor (.taylor-launcher, 32px) */
  border: none; border-radius: 50%;          /* circle (2026-11-16, Mark) */
  background: var(--coral-500);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(216, 90, 48, 0.25);
}
.texts-topbar-btn:hover { background: #C24E27; }
/* Mail button sits left of Texts, same circle (2026-11-16). */
.mail-topbar-btn { margin-right: 0; }   /* same gap as the rest of .topbar-right (Mark, 2026-11-16: "space these out slightly more") */
/* Mail's count is gray, not ink (Mark, 2026-11-16). #5B616B with white text = 6.3:1. */
.mail-topbar-btn .texts-badge { background: var(--slate, #5B616B); }
.texts-topbar-btn:focus-visible { outline: 2px solid var(--coral-300); outline-offset: 2px; }
.texts-topbar-btn[aria-expanded="true"] { background: #B4432A; }
.texts-badge {
  /* Ink, not coral, so it stands out on the coral tile. */
  position: absolute; top: -7px; right: -7px;
  min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border-radius: 10px; background: var(--ink); color: #fff; border: 2px solid #fff;
  font-size: 13.5px; font-weight: 700; line-height: 16px; text-align: center;
}
.texts-badge[hidden] { display: none; }

/* ── window (same card as .taylor-panel) ─────────────────────── */
.texts-panel {
  /* top and height are set from the top bar in texts-panel.js */
  position: fixed; right: 26px; top: 58px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 72px);
  background: #FAFAFB; border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(20, 20, 25, 0.22);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 9045;                              /* just under Taylor's window */
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--ink);
}
.texts-panel[hidden] { display: none; }
.texts-panel.texts-min { height: auto !important; }
.texts-panel.texts-min .texts-main,
.texts-panel.texts-min .texts-compose-wrap { display: none; }
.texts-panel.texts-min .texts-head { position: relative; background: #F1F2F5; padding-bottom: 8px; }
.texts-panel.texts-min .texts-head::before { display: none; }

.texts-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── header (same as .taylor-head in look C) ─────────────────── */
.texts-head {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 8px 16px; background: transparent; color: var(--ink);
}
.texts-head::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(241,242,245,0.82) 0%, rgba(241,242,245,0.55) 50%, rgba(241,242,245,0) 100%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
}
.texts-hbtn {
  width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent;
  color: var(--slate); cursor: pointer; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.texts-hbtn i { font-size: 18px; line-height: 1; }
.texts-hbtn:hover { background: rgba(20, 22, 28, 0.06); }
.texts-hbtn:focus { outline: none; }
.texts-hbtn:focus-visible { outline: 2px solid var(--coral-300); outline-offset: 1px; }
.texts-status {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  font: 750 14px/1.2 'Inter', sans-serif; margin: 0; color: var(--ink);
}
.texts-status-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.texts-status-sub { font-weight: 500; font-size: 13.5px; color: #5E6570; white-space: nowrap; }
.texts-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #9AA3AD; }
.texts-status-dot.texts-ok { background: #1F9D6B; box-shadow: 0 0 0 3px rgba(31,157,107,.15); }

/* ── scroll area under the header ────────────────────────────── */
.texts-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 60px 12px 12px; }
.texts-empty { padding: 16px 6px; color: var(--dim); font-size: 14px; line-height: 1.5; }
.texts-empty p { margin: 0 0 8px; }
.texts-empty strong { color: var(--ink); }

/* ── conversation list ────────────────────────────────────────── */
.texts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.texts-row {
  width: 100%; border: none; background: #fff; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 8px; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 22, 28, 0.07);
}
.texts-row:hover { box-shadow: 0 1px 2px rgba(20, 22, 28, 0.07), 0 0 0 1px var(--coral-200); }
.texts-row:focus-visible { outline: 2px solid var(--coral-300); outline-offset: 1px; }
.texts-dot { width: 8px; flex: 0 0 8px; display: flex; justify-content: center; }
.texts-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--coral-500); }
.texts-dot[hidden] { display: flex; visibility: hidden; }
.texts-av {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%;
  background: var(--coral-50); color: #A9431F;
  font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.texts-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.texts-row-top { display: flex; justify-content: space-between; gap: 8px; }
.texts-row-name { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.texts-row-time { font-size: 13.5px; color: #6B7380; flex: 0 0 auto; }
.texts-row-flag { font-size: 13.5px; font-weight: 700; color: #B4432A; }
.texts-row-flag-muted { color: #5E6570; }
.texts-row-preview { font-size: 14px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── new text ─────────────────────────────────────────────────── */
.texts-search-row {
  display: flex; align-items: center; gap: 6px; margin: 0 1px 10px;
  background: #fff; border-radius: 999px; padding: 4px 12px;
  box-shadow: 0 2px 10px rgba(20,22,28,0.08), 0 0 0 1px rgba(20,22,28,0.06);
}
.texts-search-row:focus-within { box-shadow: 0 2px 10px rgba(20,22,28,0.08), 0 0 0 1px var(--coral-300); }
.texts-label { font-size: 14px; color: #5E6570; font-weight: 600; }
.texts-input { flex: 1 1 auto; height: 32px; border: none; background: transparent; outline: none; font: inherit; font-size: 14px; color: var(--ink); min-width: 0; }

/* ── thread ───────────────────────────────────────────────────── */
.texts-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.texts-stamp { align-self: center; font: 500 10.5px/1 'Inter', sans-serif; color: #6B7380; margin: 8px 0 0; }
.texts-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.texts-in { align-self: flex-start; align-items: flex-start; }
.texts-out { align-self: flex-end; align-items: flex-end; }
.texts-bubble { padding: 8px 11px; border-radius: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.texts-in .texts-bubble { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,22,28,0.07); }
.texts-out .texts-bubble { background: var(--coral-500); color: #fff; }
.texts-out .texts-bubble-draft { background: #fff; color: var(--ink); border: 1.5px dashed var(--coral-500); }
.texts-out .texts-bubble-scheduled { background: #fff; color: var(--ink); border: 1.5px solid var(--coral-300); }
.texts-out .texts-bubble-failed { background: var(--coral-50); color: var(--ink); border: 1px solid var(--coral-200); }
.texts-delivered { align-self: flex-end; font-size: 13px; color: #6B7380; padding-right: 2px; margin-top: -4px; }
.texts-draft { margin-top: 6px; }
.texts-draft-label { font-size: 13.5px; font-weight: 700; color: #B4432A; }
.texts-draft-label-muted { color: #5E6570; }
.texts-note { font-size: 13.5px; color: #5E6570; display: block; text-align: right; line-height: 1.4; }
.texts-note i { font-size: 14px; vertical-align: -1px; margin-right: 3px; }
.texts-in .texts-note { text-align: left; }
.texts-note-failed { color: #A3341B; }
.texts-draft-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* Same as Taylor's starter/chip buttons */
.texts-pill {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font: 600 12px/1 'Inter', sans-serif; color: var(--slate); cursor: pointer;
}
.texts-pill:hover { border-color: var(--coral-200); color: #B84A24; }
.texts-pill-primary { border-color: var(--coral-500); background: var(--coral-500); color: #fff; }
.texts-pill-primary:hover { background: #c04a28; color: #fff; }
.texts-pill:disabled { opacity: 0.55; cursor: default; }
.texts-edit-box {
  width: 280px; max-width: 100%; box-sizing: border-box;
  border: 1px solid var(--coral-300); border-radius: 14px; background: #fff;
  padding: 8px 11px; font: inherit; font-size: 14px; line-height: 1.42; color: var(--ink); resize: vertical; outline: none;
}
.texts-error { font-size: 13.5px; color: #A3341B; max-width: 280px; text-align: right; }

/* ── composer (same as Taylor's pill message box) ────────────── */
.texts-compose-wrap { flex-shrink: 0; background: #FAFAFB; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.texts-compose {
  display: flex; align-items: flex-end; gap: 2px; margin: 0 1px;
  background: #fff; border-radius: 20px; padding: 4px 5px 4px 12px;
  box-shadow: 0 2px 10px rgba(20,22,28,0.08), 0 0 0 1px rgba(20,22,28,0.06);
}
.texts-compose:focus-within { box-shadow: 0 2px 10px rgba(20,22,28,0.08), 0 0 0 1px var(--coral-300); }
.texts-compose-input {
  flex: 1 1 auto; min-height: 32px; max-height: 140px; box-sizing: border-box;
  border: none; background: transparent; outline: none; padding: 7px 0;
  font: inherit; font-size: 14px; line-height: 1.4; color: var(--ink); resize: none; min-width: 0;
}
.texts-send-btn {
  width: 32px; height: 32px; flex: 0 0 32px; border: none; border-radius: 50%;
  background: var(--coral-500); color: #fff; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.texts-send-btn:hover { background: #c04a28; }
.texts-send-btn:disabled { opacity: 0.5; cursor: default; }
.texts-send-btn:focus { outline: none; }
.texts-send-btn:focus-visible { outline: 2px solid var(--coral-300); outline-offset: 2px; }
.texts-quiet {
  font-size: 13.5px; color: var(--ink); background: #fff;
  border-radius: 12px; padding: 7px 10px; display: flex; gap: 6px; align-items: flex-start;
  box-shadow: 0 1px 2px rgba(20,22,28,0.07);
}
.texts-quiet i { font-size: 14px; line-height: 1.3; }
.texts-compose-note {
  font-size: 14px; color: var(--dim); line-height: 1.45; padding: 8px 10px;
  background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(20,22,28,0.07);
}
.texts-footnote { font-size: 13px; color: #6B7380; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line (Mark, 2026-11-17) */

@media (max-width: 520px) {
  .texts-panel { right: 8px; left: 8px; width: auto; max-width: none; }
  .texts-compose-input, .texts-input { font-size: 16px; }
}

/* ── Send from my phone (2026-11-17): phone only ─────────────────── */
.texts-phone-btn {
  align-self: stretch; height: 44px; margin-top: 2px; border: none; border-radius: 999px;
  background: var(--coral-500); color: #fff; font: 800 14px/1 'Inter', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.texts-phone-btn:hover { background: #C24E27; }
.texts-phone-btn:disabled { opacity: .6; cursor: progress; }
.texts-phone-btn .texts-ic { width: 17px; height: 17px; }
.texts-note .texts-ic { vertical-align: -3px; }
.texts-note-center { text-align: center; }
.texts-linkbtn { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: #A63A1E; text-decoration: underline; cursor: pointer; }
.texts-send-btn .texts-ic { width: 17px; height: 17px; }

/* Copy (2026-11-17): one click copies a draft to paste into your own messaging app. */
.texts-pill { display: inline-flex; align-items: center; gap: 5px; }
.texts-pill .texts-ic { width: 14px; height: 14px; }
.texts-copied { color: #5E6570; }
.texts-copied .texts-ic { vertical-align: -2px; }

/* Taylor's suggestion card (2026-11-17): a meeting / showing / to-do Taylor
   spotted in an incoming text. Nothing is saved until "Add to calendar". */
.texts-plan { list-style: none; align-self: stretch; background: #fff; border: 1px solid #E6E8EC; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 2px rgba(17,17,20,.06); }
.texts-plan-head { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; color: #B4432A; } /* coral, same as the draft label: no blue (Mark, 2026-11-17) */
.texts-plan-head .texts-ic { width: 16px; height: 16px; }
.texts-plan-row { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; font-weight: 700; color: #5E6570; min-width: 0; flex: 1 1 0; }
.texts-plan-two { display: flex; gap: 8px; }
.texts-plan-input { height: 34px; border: 1px solid #D5D9E0; border-radius: 8px; padding: 0 10px; font: 500 13px 'Inter', sans-serif; color: var(--ink); background: #fff; min-width: 0; box-sizing: border-box; width: 100%; }
.texts-plan-input:focus { outline: 2px solid var(--coral-300); outline-offset: 0; border-color: transparent; }
.texts-plan-meta { font-size: 14px; color: #434B58; }
.texts-plan-done { list-style: none; align-self: center; display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #5E6570; font-weight: 600; } /* muted gray, not teal (Mark, 2026-11-17) */
.texts-draft-label .texts-ic { vertical-align: -1px; }

/* Consent by email link (2026-11-17, Mark): "Ask by email" under a
   conversation with someone who hasn't agreed to texts. */
.texts-ask-row { display: flex; justify-content: center; padding: 2px 0 4px; }
.texts-ask-row .texts-pill { display: inline-flex; align-items: center; gap: 6px; }
.texts-ask { background: #fff; border: 1px solid #E6E8EC; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 2px rgba(17,17,20,.06); }
.texts-ask-head { font-size: 14px; font-weight: 800; color: #B4432A; overflow-wrap: anywhere; }
.texts-ask-body { border: 1px solid #D5D9E0; border-radius: 8px; padding: 8px 10px; font: 500 13px/1.45 'Inter', sans-serif; color: var(--ink); background: #fff; resize: vertical; min-height: 140px; width: 100%; box-sizing: border-box; }
.texts-ask-body:focus { outline: 2px solid var(--coral-300); outline-offset: 0; border-color: transparent; }
.texts-ask-hint { text-align: left; }
.texts-ask-err { max-width: none; text-align: left; }
