/* BlurTexter — every screen, scoped under .tx-app (docs/CHAT.md, docs/BRAND.md).
   The family's look (K6): BlurFolder's palette, bar, buttons, type and corners,
   the values BlurCalendar carries too. Light only, as theirs are. Phone first:
   the chat is one pane at a time below 720px. */

.tx-app {
  --tx-teal: #00c6cf;          /* BlurPaper's teal, every sibling's */
  --tx-teal-dark: #00a3ab;
  --tx-teal-soft: #e0f7f8;
  --tx-teal-ink: #00636a;      /* teal text on a light ground: readable */
  --tx-ink: #2f3440;
  --tx-muted: #6b7280;
  --tx-line: #e3e6ec;
  --tx-bg: #f6f8fa;
  --tx-card: #ffffff;
  --tx-bad: #c0392b;
}
.tx-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--tx-bg);
  color: var(--tx-ink);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.tx-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; background: #fff; border-bottom: 1px solid var(--tx-line); position: relative; z-index: 20; }
.tx-brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--tx-teal); font-size: 1.35rem; text-decoration: none; white-space: nowrap; }
.tx-brand b { font-weight: 700; }
.tx-logo { display: block; width: 28px; height: 28px; border-radius: 4px; }
.tx-nav { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.tx-who { color: var(--tx-muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.tx-main { flex: 1 1 auto; width: 100%; max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem; box-sizing: border-box; }
.tx-foot { padding: 1rem; text-align: center; color: var(--tx-muted); font-size: 0.85rem; }
.tx-muted { color: var(--tx-muted); }
.tx-error { color: var(--tx-bad); }
.tx-pad { padding: 1rem; }
.tx-center { text-align: center; }

/* Buttons: background, colour, border and radius together — BlurPager's
   baseline `button` rule paints white text and its own corners (its D143). */
.tx-app .tx-button, .tx-app button.tx-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.2rem;
  border: 1px solid var(--tx-teal); border-radius: 6px; background: var(--tx-teal); color: #fff;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.tx-app .tx-button:hover { background: var(--tx-teal-dark); border-color: var(--tx-teal-dark); }
.tx-app .tx-small, .tx-app button.tx-small { padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.tx-app .tx-wide { display: flex; width: 100%; }
.tx-app button.tx-quiet, .tx-app button.tx-link, .tx-app button.tx-ghost, .tx-app summary.tx-quiet {
  padding: 0.3rem 0.6rem; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--tx-muted); font: inherit; cursor: pointer;
}
.tx-app button.tx-ghost { border-color: var(--tx-line); background: #fff; color: var(--tx-ink); }
.tx-app button.tx-ghost:hover { border-color: var(--tx-teal); }
.tx-app button.tx-link { color: var(--tx-teal-dark); text-decoration: underline; padding: 0; }
.tx-app button.tx-quiet:hover, .tx-app summary.tx-quiet:hover { background: rgba(0, 0, 0, 0.05); color: var(--tx-ink); }
.tx-app button:disabled { opacity: 0.6; cursor: default; }
.tx-paper-mark { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; border-radius: 2px; }
h1 .tx-paper-mark { margin-right: 0.45rem; }

.tx-card { background: var(--tx-card); border: 1px solid var(--tx-line); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.tx-narrow { max-width: 26rem; margin: 2rem auto; }
.tx-card h1 { margin: 0 0 1rem; font-size: 1.4rem; display: flex; align-items: center; }
.tx-or { text-align: center; margin: 1rem 0 0; color: var(--tx-muted); }

.tx-hero { padding: 2rem 0; }
.tx-hero h1 { font-size: 2rem; margin: 0 0 1rem; line-height: 1.2; }
.tx-lead { font-size: 1.1rem; line-height: 1.6; max-width: 40rem; }
.tx-points { line-height: 1.8; padding-left: 1.2rem; }

/* ---- The chat (functions/texter-app.js) ---- */

/* Signed in, the page is exactly the window: the bar, then the panes. */
.tx-signed-in { height: 100vh; height: 100dvh; min-height: 0; }
.tx-app .tx-chat-main { max-width: 72rem; padding: 0; display: flex; min-height: 0; }
.tx-embedded { height: 100vh; height: 100dvh; min-height: 0; }
.tx-chat { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.tx-panes { flex: 1 1 auto; display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; min-height: 0; background: #fff; border-left: 1px solid var(--tx-line); border-right: 1px solid var(--tx-line); }
.tx-panes.tx-only { grid-template-columns: 1fr; border: 0; }
.tx-note { position: absolute; left: 50%; bottom: 5rem; transform: translateX(-50%); margin: 0; padding: 0.5rem 0.9rem; border-radius: 6px; background: #fdecea; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); max-width: 90%; z-index: 5; }

.tx-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--tx-line); }
.tx-list-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tx-line); }
.tx-list-head h1 { margin: 0; font-size: 1.2rem; }
.tx-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.tx-app button.tx-item { display: flex; gap: 0.7rem; align-items: flex-start; width: 100%; padding: 0.7rem 1rem; border: 0; border-bottom: 1px solid #f0f2f5; border-radius: 0; background: #fff; color: var(--tx-ink); font: inherit; text-align: left; cursor: pointer; }
.tx-app button.tx-item:hover { background: #fafbfc; }
.tx-app button.tx-item.tx-current { background: var(--tx-teal-soft); }
.tx-avatar { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--tx-teal-soft); color: var(--tx-teal-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.tx-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.tx-item-title, .tx-item-last { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; min-width: 0; }
.tx-item-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-item-time { flex: none; color: var(--tx-muted); font-size: 0.78rem; }
.tx-item-context { color: var(--tx-teal-ink); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-item-preview { color: var(--tx-muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-unread .tx-item-name, .tx-unread .tx-item-preview { color: var(--tx-ink); font-weight: 700; }
.tx-badge { flex: none; min-width: 1.35rem; height: 1.35rem; padding: 0 0.35rem; box-sizing: border-box; border-radius: 999px; background: var(--tx-teal); color: #fff; font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.tx-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--tx-bg); }
.tx-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.tx-conv-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: #fff; border-bottom: 1px solid var(--tx-line); }
.tx-app button.tx-back { display: none; font-size: 1.8rem; line-height: 1; padding: 0 0.6rem 0.2rem; color: var(--tx-teal-dark); }
.tx-conv-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tx-conv-title h2 { margin: 0; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-context { color: var(--tx-teal-ink); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-sub { color: var(--tx-muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-tools { position: relative; }
.tx-tools summary { list-style: none; font-size: 1.3rem; line-height: 1; }
.tx-tools summary::-webkit-details-marker { display: none; }
.tx-tools-panel { position: absolute; right: 0; top: 2.2rem; z-index: 10; width: min(20rem, 85vw); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.6rem; background: #fff; border: 1px solid var(--tx-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.tx-app button.tx-leave { color: var(--tx-bad); }

.tx-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 0.75rem 0.75rem 0.25rem; overscroll-behavior: contain; }
.tx-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.tx-day { align-self: center; margin: 0.6rem 0 0.2rem; padding: 0.1rem 0.7rem; border-radius: 999px; background: #e9edf2; color: var(--tx-muted); font-size: 0.78rem; }
.tx-event { align-self: center; color: var(--tx-muted); font-size: 0.82rem; text-align: center; padding: 0.15rem 0.5rem; }
.tx-notice { align-self: center; max-width: min(36rem, 92%); display: flex; flex-direction: column; gap: 0.15rem; padding: 0.5rem 0.8rem; border: 1px solid #f1d9a6; border-radius: 10px; background: #fff7e6; color: #5a3e00; font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tx-notice time { align-self: flex-end; font-size: 0.72rem; color: #8a6a2a; }
.tx-older { align-self: center; }
.tx-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(36rem, 85%); }
.tx-msg.tx-mine { align-self: flex-end; align-items: flex-end; }
.tx-msg.tx-cont { margin-top: -0.2rem; }
.tx-author { font-size: 0.78rem; color: var(--tx-teal-ink); font-weight: 600; margin: 0.2rem 0 0.1rem 0.6rem; }
.tx-bubble { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 0.6rem; padding: 0.45rem 0.75rem; border-radius: 14px; background: #fff; border: 1px solid var(--tx-line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.tx-mine .tx-bubble { background: var(--tx-teal-soft); border-color: #bfeaec; }
.tx-pending .tx-bubble { opacity: 0.7; }
.tx-meta { margin-left: auto; font-size: 0.72rem; color: var(--tx-muted); white-space: nowrap; }
.tx-deleted { font-style: italic; color: var(--tx-muted); }
.tx-app button.tx-remove { position: absolute; top: -0.55rem; left: -0.55rem; width: 1.3rem; height: 1.3rem; padding: 0; border: 1px solid var(--tx-line); border-radius: 50%; background: #fff; color: var(--tx-muted); font-size: 0.85rem; line-height: 1; cursor: pointer; opacity: 0; }
.tx-bubble:hover button.tx-remove, .tx-app button.tx-remove:focus { opacity: 1; }
.tx-app button.tx-retry { color: var(--tx-bad); font-size: 0.78rem; }

.tx-compose { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--tx-line); }
.tx-input { overflow-y: auto; flex: 1 1 auto; min-width: 0; box-sizing: border-box; resize: none; max-height: 10rem; padding: 0.55rem 0.75rem; border: 1px solid var(--tx-line); border-radius: 18px; font: inherit; font-size: 1rem; line-height: 1.35; color: var(--tx-ink); background: #fff; }
.tx-input:focus, .tx-field:focus { outline: 2px solid var(--tx-teal); outline-offset: 0; border-color: var(--tx-teal); }
.tx-app button.tx-send { border-radius: 18px; }

.tx-dialog { width: min(28rem, calc(100vw - 2rem)); min-height: 0; box-sizing: border-box; padding: 1rem 1.25rem 1.25rem; border: 0; border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); }
.tx-dialog::backdrop { background: rgba(20, 22, 28, 0.35); }
.tx-dialog h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }
.tx-stack { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.tx-label { color: var(--tx-muted); font-size: 0.9rem; }
.tx-row { display: flex; gap: 0.5rem; align-items: center; }
.tx-end { justify-content: flex-end; }
.tx-field { flex: 1 1 auto; min-width: 0; box-sizing: border-box; width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--tx-line); border-radius: 6px; font: inherit; font-size: 1rem; color: var(--tx-ink); background: #fff; }
textarea.tx-field { resize: vertical; }

/* Requests, blocks, quotes (TX-4: K12, K13, K14) */
.tx-lists { overflow-y: auto; flex: 1 1 auto; }
.tx-lists .tx-items { overflow: visible; }
.tx-section { margin: 0; padding: 0.6rem 1rem 0.2rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tx-muted); }
.tx-section-note { margin: 0; padding: 0 1rem 0.4rem; font-size: 0.8rem; }
.tx-requests { background: #fffdf5; }
.tx-app button.tx-small-text { font-size: 0.85rem; }
.tx-request { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.75rem; background: #fff7e6; border-top: 1px solid #f1d9a6; color: #5a3e00; font-size: 0.92rem; }
.tx-cannot { justify-content: center; color: var(--tx-muted); font-size: 0.92rem; margin: 0; text-align: center; flex-wrap: wrap; }
.tx-quote { flex-basis: 100%; margin: 0 0 0.3rem; padding: 0.15rem 0.5rem; border-left: 3px solid var(--tx-teal); color: var(--tx-muted); font-size: 0.85rem; white-space: pre-wrap; }
.tx-blocked { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.tx-blocked-row { justify-content: space-between; }
.tx-grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Finding people by @username (TX-8, K16) */
.tx-picker { display: flex; flex-direction: column; gap: 0.35rem; }
.tx-found { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.tx-found-note { margin: 0; font-size: 0.85rem; }
.tx-app button.tx-found-person, .tx-dialog button.tx-found-person { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--tx-line); border-radius: 6px; background: #fff; color: var(--tx-ink); font: inherit; text-align: left; cursor: pointer; }
.tx-app button.tx-found-person:hover { border-color: var(--tx-teal); background: var(--tx-teal-soft); }
.tx-found-person .tx-avatar { width: 2rem; height: 2rem; }
.tx-found-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-found-handle { color: var(--tx-muted); font-size: 0.9rem; white-space: nowrap; }
.tx-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tx-chip { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.15rem 0.2rem 0.15rem 0.6rem; border-radius: 999px; background: var(--tx-teal-soft); color: var(--tx-teal-ink); font-size: 0.88rem; }
.tx-app button.tx-chip-x { padding: 0 0.35rem; border: 0; background: none; color: var(--tx-teal-ink); font-size: 1rem; line-height: 1; cursor: pointer; }
.tx-dialog .tx-link { padding: 0; border: 0; background: none; color: var(--tx-teal-dark); text-decoration: underline; font: inherit; cursor: pointer; }

/* A phone, or a narrow frame: one pane at a time. */
@media (max-width: 720px) {
  .tx-panes { grid-template-columns: 1fr; border: 0; }
  .tx-chat .tx-conv { display: none; }
  .tx-chat.tx-showing-conv .tx-conv { display: flex; }
  .tx-chat.tx-showing-conv .tx-list { display: none; }
  .tx-list { border-right: 0; }
  .tx-app button.tx-back { display: inline-flex; }
  .tx-app button.tx-remove { opacity: 0.8; }
  .tx-bar { padding: 0.5rem 0.75rem; }
  .tx-who { display: none; }
  .tx-hero h1 { font-size: 1.6rem; }
  .tx-msg { max-width: 88%; }
}
