/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:       #0a0a0f;
  --surface:  #111118;
  --surface2: #1a1a24;
  --surface3: #222230;
  --border:   #2a2a3a;
  --border2:  #3a3a50;
  --accent:   #00e5a0;
  --accent2:  #7c6fff;
  --accent3:  #ff6b6b;
  --accent4:  #ffd166;
  --text:     #e8e8f0;
  --muted:    #6b6b88;
  --muted2:   #4a4a64;
  --mono:     'Space Mono', monospace;
  --sans:     'Syne', sans-serif;

  --radius:   8px;
  --radius-sm: 4px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(124,111,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(0,229,160,0.05) 0%, transparent 55%);
  background-attachment: fixed;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "header header header"
    "accounts feed detail";
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
  grid-area: header;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.logo {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.logo-slash { color: var(--muted2); }

.header-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Accounts sidebar ───────────────────────────────────────────────────────── */
.accounts-panel {
  grid-area: accounts;
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}

.panel-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 6px;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}

.account-card:hover {
  border-color: var(--border2);
  transform: translateX(2px);
}

.account-card.type-credit { border-left: 3px solid var(--accent3); }
.account-card.type-debit  { border-left: 3px solid var(--accent); }
.account-card.type-wallet { border-left: 3px solid var(--accent2); }
.account-card.type-cash   { border-left: 3px solid var(--accent4); }

.account-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-balance {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.account-balance.positive       { color: var(--accent); }
.account-balance.negative       { color: var(--accent3); }
.account-balance.owed           { color: var(--accent3); }
.account-balance.credit_surplus { color: var(--accent); }

.account-type-badge {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.accounts-loading {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

/* ── Main feed ──────────────────────────────────────────────────────────────── */
.feed-panel {
  grid-area: feed;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}

/* ── Composer ───────────────────────────────────────────────────────────────── */
.composer {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.composer-inner {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.composer-inner:focus-within {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(124,111,255,0.08);
}

.composer-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: none;
  min-height: 64px;
  caret-color: var(--accent);
}

.composer-textarea::placeholder { color: var(--muted); }

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.char-count {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  transition: color 0.2s;
}

.char-count.warn { color: var(--accent4); }
.char-count.over { color: var(--accent3); }

.composer-hints {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted2);
  letter-spacing: 0.05em;
}

/* ── Post button ────────────────────────────────────────────────────────────── */
.post-btn {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.post-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,229,160,0.25);
}

.post-btn:active:not(:disabled) { transform: translateY(0); }

.post-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* RESTORED: loading state — button turns purple and pulses while AI processes */
.post-btn.loading {
  background: var(--accent2);
  color: white;
  animation: btn-pulse 1s ease-in-out infinite;
}

@keyframes btn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Processing banner ──────────────────────────────────────────────────────── */
.processing-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(124,111,255,0.08);
  border-bottom: 1px solid rgba(124,111,255,0.15);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent2);
}

.processing-banner.visible { display: flex; }

.processing-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(124,111,255,0.2);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Timeline ───────────────────────────────────────────────────────────────── */
.timeline {
  flex: 1;
  padding: 0;
}

.timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
  color: var(--muted);
}

.timeline-empty-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.timeline-empty-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ── Transaction card ───────────────────────────────────────────────────────── */
.txn-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.txn-card:hover  { background: rgba(255,255,255,0.02); }
.txn-card.active { background: rgba(124,111,255,0.05); }

/* RESTORED: amber left-border for pending clarification cards */
.txn-card.clarification-needed {
  border-left: 3px solid var(--accent4);
}

/* Intent colour strips */
.txn-card.intent-EXPENSE  { }
.txn-card.intent-INCOME   { border-left: 3px solid var(--accent); }
.txn-card.intent-TRANSFER { border-left: 3px solid var(--accent2); }
.txn-card.intent-QUERY    { border-left: 3px solid var(--muted); }

/* ── Onboarding system message card ────────────────────────────────────────── */
.onboarding-system {
  background: var(--surface2);
  border: 1px solid var(--accent2);
  border-left: 3px solid var(--accent2);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 8px;
}

.intent-system {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(124,111,255,0.15);
  color: var(--accent2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.onboarding-prompt-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  margin: 10px 0 8px;
  white-space: pre-line;
}

.onboarding-hint {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 6px;
}

.txn-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.txn-raw-tweet {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

.txn-time {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

/* RESTORED: green reply text, amber for clarification-pending */
.txn-reply {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-line;
}

.txn-reply.reply-clarification { color: var(--accent4); }

/* Running ledger line — account balance immediately after this transaction.
   Positioned between the AI reply text and the thread/meta section.
   Muted monospace: functional data, not the primary message. */
.txn-balance-after {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  padding: 0 0 6px;
  letter-spacing: 0.01em;
}

.txn-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-intent-EXPENSE    { background: rgba(255,107,107,0.12); color: var(--accent3); }
.badge-intent-INCOME     { background: rgba(0,229,160,0.12);   color: var(--accent); }
.badge-intent-TRANSFER   { background: rgba(124,111,255,0.12); color: var(--accent2); }
.badge-intent-QUERY      { background: rgba(107,107,136,0.15); color: var(--muted); }
.badge-intent-CORRECTION { background: rgba(255,209,102,0.12); color: var(--accent4); }
.badge-intent-UNKNOWN    { background: rgba(107,107,136,0.15); color: var(--muted); }

.badge-confidence-high   { background: rgba(0,229,160,0.1);   color: var(--accent); }
.badge-confidence-medium { background: rgba(255,209,102,0.1); color: var(--accent4); }
.badge-confidence-low    { background: rgba(255,107,107,0.1); color: var(--accent3); }

.badge-account {
  background: rgba(124,111,255,0.1);
  color: var(--accent2);
}

/* RESTORED: italic dotted badge for AI-inferred account */
.badge-inferred {
  background: transparent;
  border: 1px solid var(--muted2);
  color: var(--muted);
  font-style: italic;
}

/* ── Load more ──────────────────────────────────────────────────────────────── */
.load-more-trigger {
  padding: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.load-more-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 20px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.load-more-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ── Detail panel ───────────────────────────────────────────────────────────── */
.detail-panel {
  grid-area: detail;
  padding: 20px 16px;
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--muted2);
}

.detail-empty-icon { font-size: 1.8rem; opacity: 0.3; }

.detail-empty-text {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ── Detail card (RESTORED: full structured layout from index_old) ──────────── */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* RESTORED: distinct header section for original tweet */
.detail-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.detail-card-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-tweet-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

/* RESTORED: coloured reply block in detail panel */
.detail-reply {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  line-height: 1.6;
  white-space: pre-line;
  background: rgba(0,229,160,0.03);
}

.detail-reply.reply-clarification {
  color: var(--accent4);
  background: rgba(255,209,102,0.03);
}

/* RESTORED: structured key/value fields section */
.detail-fields {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.detail-field:last-child { border-bottom: none; }

.field-key {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-val {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
  text-align: right;
}

.field-val.null-val { color: var(--muted2); font-style: italic; }
.field-val.accent   { color: var(--accent); }
.field-val.accent2  { color: var(--accent2); }
.field-val.accent3  { color: var(--accent3); }
.field-val.accent4  { color: var(--accent4); }

/* RESTORED: ai provenance footer block */
.detail-provenance {
  padding: 10px 16px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}

.provenance-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 6px;
}

.provenance-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  padding: 2px 0;
}

.provenance-val { color: var(--text); }

/* ── Clarification banner ───────────────────────────────────────────────────── */
.clarification-banner {
  background: rgba(255,209,102,0.06);
  border: 1px solid rgba(255,209,102,0.2);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 12px 16px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent4);
  line-height: 1.5;
}

/* ── RESTORED: Clarification reply input in the detail panel ───────────────── */
.clarification-reply-form {
  margin: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clarification-reply-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--accent4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clarification-reply-input {
  background: var(--surface2);
  border: 1px solid rgba(255,209,102,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  resize: none;
  width: 100%;
  min-height: 56px;
  outline: none;
  transition: border-color 0.15s;
}

.clarification-reply-input:focus {
  border-color: var(--accent4);
}

.clarification-reply-input::placeholder { color: var(--muted2); }

.clarification-reply-btn {
  align-self: flex-end;
  background: rgba(255,209,102,0.12);
  border: 1px solid rgba(255,209,102,0.3);
  border-radius: var(--radius-sm);
  color: var(--accent4);
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s, border-color 0.15s;
}

.clarification-reply-btn:hover {
  background: rgba(255,209,102,0.2);
  border-color: var(--accent4);
}

.clarification-reply-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Toast notifications ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.25s ease-out;
  max-width: 320px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.toast-success { border-left: 3px solid var(--accent); }
.toast.toast-warn    { border-left: 3px solid var(--accent4); }
.toast.toast-error   { border-left: 3px solid var(--accent3); }

/* RESTORED: icon span in toast */
.toast-icon { font-size: 0.9rem; flex-shrink: 0; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr;
    grid-template-areas:
      "header"
      "accounts"
      "feed";
  }
  .detail-panel { display: none; }
  .accounts-panel {
    position: static;
    height: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .account-card { min-width: 140px; margin-bottom: 0; }
  .panel-label { display: none; }
}

/* ── Day 7: Thread styles ─────────────────────────────────────────────────── */

/* Resolved parent card — green border replaces amber when child confirms it */
.txn-card.thread-resolved {
  border-left: 3px solid var(--accent);
}

/* Threaded reply sub-row — indented child tweet under the parent */
.thread-reply {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 0 16px;
  border-left: 2px solid var(--border2);
  margin: 8px 0 4px 4px;
}

.thread-reply-connector {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted2);
  flex-shrink: 0;
}

.thread-reply-text {
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
  line-height: 1.3;
}

.thread-reply-time {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted2);
  flex-shrink: 0;
}

/* Inline reply button on pending cards */
.txn-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(255,209,102,0.08);
  border: 1px solid rgba(255,209,102,0.25);
  border-radius: var(--radius-sm);
  color: var(--accent4);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.txn-reply-btn:hover {
  background: rgba(255,209,102,0.15);
  border-color: rgba(255,209,102,0.4);
}

/* Inline reply input — expands on the card itself */
.txn-inline-reply {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fade-in 0.15s ease-out;
}

.txn-inline-reply-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid rgba(255,209,102,0.3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 7px 10px;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
}

.txn-inline-reply-input:focus {
  border-color: var(--accent4);
}

.txn-inline-reply-input::placeholder { color: var(--muted2); }

.txn-inline-reply-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.txn-inline-send-btn {
  padding: 4px 12px;
  background: var(--accent4);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.txn-inline-send-btn:hover   { opacity: 0.85; }
.txn-inline-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.txn-inline-cancel-btn {
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: pointer;
  transition: color 0.15s;
}

.txn-inline-cancel-btn:hover { color: var(--text); }

/* Detail panel thread section */
.detail-thread {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.detail-thread-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 8px;
}

.detail-thread-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.detail-thread-item:last-child { border-bottom: none; }

.detail-thread-connector {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted2);
  flex-shrink: 0;
}

.detail-thread-tweet {
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1;
}

.detail-thread-time {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted2);
}

/* Detail panel reply form — shown when pending, no banner needed */
.detail-reply-form {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,209,102,0.02);
}

.detail-reply-form-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent4);
}


/* ── Day 10: Onboarding step progress ──────────────────────────────────────── */

.onboarding-step-progress {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-left: 8px;
}

/* ── Day 10: Composer disabled during onboarding ───────────────────────────── */

/* Option A: composer stays interactive during onboarding.
   Backend OnboardingAgent gates all input — no frontend lock needed. */

.composer-locked-hint {
  display: none;
  font-size: 0.7rem;
  color: var(--accent2);
  font-family: var(--mono);
  text-align: center;
  margin-top: 6px;
  opacity: 0.8;
}

.composer.onboarding-locked .composer-locked-hint {
  display: block;
}

/* ── Day 10: Account state badges ──────────────────────────────────────────── */

.account-state-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.55rem;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 4px;
}

.account-state-badge.confirmed {
  background: rgba(0, 200, 150, 0.12);
  color: #00c896;
}

.account-state-badge.skipped {
  background: rgba(120, 120, 140, 0.15);
  color: var(--muted);
}

.account-state-badge.pending {
  background: rgba(255, 180, 50, 0.12);
  color: #ffb432;
}

.account-state-badge.active {
  background: rgba(0, 200, 150, 0.12);
  color: #00c896;
}

/* ── Privacy Notice Overlay (Day 14) ─────────────────────────────────────────
   Full-screen modal gate. User must acknowledge before seeing the app.
   Same dark aesthetic as the rest of the UI — not a jarring interruption.
   Consistent with the tweet card visual language.                           */

#privacyOverlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.privacy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent4, #ffd166);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 520px;
  width: 100%;
}

.privacy-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.privacy-lock {
  font-size: 1.3rem;
}

.privacy-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.privacy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.privacy-list li {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.privacy-list li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--accent4, #ffd166);
  font-size: 0.55rem;
  top: 4px;
}

.consent-btn {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent, #00e5a0);
  color: #0a0a0f;
  border: none;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.consent-btn:hover:not(:disabled) {
  opacity: 0.88;
}

.consent-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.consent-error {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--accent3, #ff6b6b);
  text-align: center;
}
