/* ── Liravira shared components ──────────────────────────────────────────────
   Loaded by BOTH board.html and index.html (after the page's own stylesheet).
   Holds the cross-surface pieces: language UI, the statement block, and the
   progressive-disclosure depth component (groups -> item line -> detail).
   Uses the CSS variables declared in each page's :root.
--------------------------------------------------------------------------- */

.mono { font-variant-numeric: tabular-nums; }

/* ── Language toggle ── */
.lang-toggle {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 5px 10px; border-radius: 20px;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── First-run language picker ── */
.lang-picker {
  position: fixed; inset: 0; z-index: 2000; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(17, 24, 39, .6);
}
.lang-card {
  background: var(--card); border-radius: 16px; padding: 32px 28px;
  max-width: 360px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.lang-logo { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.lang-logo .wm { color: var(--accent); font-weight: 500; }   /* wordmark: Lira|vira split */
.lang-q { font-size: 16px; font-weight: 600; line-height: 1.5; margin-bottom: 20px; }
.lang-q span { font-size: 13px; font-weight: 400; color: var(--muted); }
.lang-opts { display: flex; flex-direction: column; gap: 10px; }
.lang-opts button {
  padding: 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-family: var(--font); font-size: 15px;
  font-weight: 600; cursor: pointer;
}
.lang-opts button:hover { border-color: var(--accent); background: #f5f8ff; }

/* ── Statement block (L0/L1 headline numbers) ── */
.stmt-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--card);
}
.stmt-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.stmt-row:last-child { border-bottom: none; }
.stmt-row.dim { color: var(--muted); }
.stmt-row .big { font-size: 24px; font-weight: 700; color: var(--green); }

/* ── L2: category groups ── */
.ledger-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  margin-bottom: 10px;
}
.ledger-group:last-child { margin-bottom: 0; }
.ledger-group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; cursor: pointer; list-style: none;
  font-weight: 600;
}
.ledger-group-head::-webkit-details-marker { display: none; }
.ledger-group[open] .ledger-group-head { border-bottom: 1px solid var(--line); }
.lg-label { font-size: 13px; }
.lg-total { font-size: 13px; color: var(--green); font-weight: 600; }

.ledger-main { padding: 11px 14px 12px; }

/* ── L3: the item — title + the REAL benefit metric + countdown ── */
.impact-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}
.il-title { font-weight: 600; flex: 1; min-width: 0; }
.il-amt { color: var(--green); font-weight: 700; white-space: nowrap; font-size: 14px; }
.il-amt.is-cost { color: var(--amber); }
.il-when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.impact-line.u .il-when { color: var(--red); font-weight: 600; }
.impact-line.w .il-when { color: var(--amber); font-weight: 600; }

/* the one-line "what to do", visible with no clicks */
.il-action { margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* ── L4: the "why" + source, one tap away ── */
.ledger-why { margin-top: 8px; }
.ledger-why > summary {
  cursor: pointer; list-style: none; font-size: 12px; color: var(--accent);
  display: inline-block;
}
.ledger-why > summary::-webkit-details-marker { display: none; }
.ledger-why > summary::before { content: "ⓘ "; }
.why-body { margin-top: 6px; font-size: 13px; color: #374151; }
.why-body p { margin-bottom: 6px; }
.why-body p:last-child { margin-bottom: 0; }
.li-src a { color: var(--accent); font-size: 12px; text-decoration: none; }
.li-src a:hover { text-decoration: underline; }

/* "+ N more" reveals the remaining items in a group */
.ledger-more { border-top: 1px solid var(--line); }
.ledger-more > summary {
  padding: 10px 14px; cursor: pointer; font-size: 12px; color: var(--accent);
  list-style: none;
}
.ledger-more > summary::-webkit-details-marker { display: none; }
.ledger-more > summary:hover { background: #f5f8ff; }
.ledger-rest { padding: 2px 14px 12px; }
.ledger-rest .ledger-item + .ledger-item {
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px;
}

.empty-state { padding: 24px 0; color: var(--muted); }
.empty-state a { color: var(--accent); font-weight: 600; }

/* ── Demo auth (placeholder while there is no Clerk account — auth.js) ──
   Self-contained: board.html doesn't load chat.css, so the modal styles its
   own submit button instead of relying on .gate-cta. */
.auth-btn {
  border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink, #111);
  border-radius: 999px; padding: 5px 14px; font-family: var(--font);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.auth-btn:hover { border-color: var(--accent); color: var(--accent); }
.auth-chip {
  font-size: 12px; font-weight: 600; color: var(--muted);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; vertical-align: middle; margin-right: 6px;
}
.demo-auth-veil {
  position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.demo-auth-card {
  position: relative; background: #fff; border-radius: 14px; padding: 24px 22px 22px;
  width: min(340px, 92vw); font-family: var(--font);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.demo-auth-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.demo-auth-note { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.demo-auth-x {
  position: absolute; top: 10px; right: 12px; border: none; background: none;
  font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1;
}
.demo-auth-x:hover { color: var(--ink, #111); }
.demo-auth-form { display: flex; flex-direction: column; gap: 10px; }
.demo-auth-form input {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-family: var(--font); font-size: 13px;
}
.demo-auth-form input:focus { outline: none; border-color: var(--accent); }
.demo-auth-form button {
  border: none; border-radius: 10px; background: var(--accent); color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 650;
  padding: 10px 16px; cursor: pointer;
}
.demo-auth-form button:hover { filter: brightness(.92); }
