/* Meridian — a small banking UI for the QA second-round app. */

:root {
  --bg:          #0b1220;
  --bg-soft:     #111a30;
  --panel:       #ffffff;
  --panel-soft:  #f7f9fc;
  --ink:         #0f172a;
  --ink-2:       #334155;
  --muted:       #64748b;
  --accent:      #3d8bfd;
  --accent-2:    #2563eb;
  --ok:          #16a34a;
  --warn:        #ea580c;
  --danger:      #dc2626;
  --border:      #e2e8f0;
  --border-2:    #cbd5e1;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #eef2f8;
}

button, input {
  font-family: inherit;
  font-size: inherit;
}

.app {
  display: grid;
  grid-template-columns: 220px 1fr 360px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Nav rail */
.nav {
  background: var(--bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #3d8bfd, #8b5cf6);
}
.brand-name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }

.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  text-decoration: none;
  color: #94a3b8;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { color: #e2e8f0; background: rgba(148, 163, 184, 0.08); }
.nav-link.active { background: rgba(61, 139, 253, 0.14); color: #fff; }
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5;
}

.session-pill {
  margin-top: auto;
  font-size: 11px;
  color: #64748b;
  padding: 8px 10px;
  border: 1px solid #1e293b;
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
}

/* Main column */
.main {
  padding: 28px 32px 40px;
  overflow-y: auto;
}

.view-hdr { margin-bottom: 20px; }
.view-hdr h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.view-sub { color: var(--muted); font-size: 13px; }

.cards-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.balance-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #e2e8f0;
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.balance-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #94a3b8; margin-bottom: 10px;
}
.balance-amount {
  font-size: 34px; font-weight: 700; letter-spacing: -0.01em; color: #fff;
}
.balance-sub { font-size: 12px; color: #94a3b8; margin-top: 8px; }

.quick-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
}
.quick-hdr {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.quick-line {
  display: flex; justify-content: space-between; font-size: 13px;
}
.status-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 3px;
  background: #dcfce7; color: #166534; border: 1px solid #bbf7d0;
}
.status-chip.locked { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.btn-ghost {
  margin-top: auto;
  background: transparent;
  color: var(--accent-2);
  border: none;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
.btn-ghost:hover { color: var(--accent); }

/* Panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.transfer-panel {
  position: relative;
  z-index: 5;
  overflow: visible;
}
.transfer-panel .panel-hdr {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.transfer-panel .panel-body {
  position: relative;
}
.panel-hdr {
  padding: 14px 18px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

/* Transaction list */
.tx-list { list-style: none; }
.tx-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 100px 110px;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tx-list li:last-child { border-bottom: none; }
.tx-date {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.tx-direction {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.tx-party {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.tx-party strong {
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-party span {
  color: var(--muted);
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-status { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tx-amt    { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tx-amt.neg { color: var(--ink); }
.tx-amt.pos { color: var(--ok); }
.tx-status.pending { color: var(--warn); }

/* Cards view */
.panel-card { padding: 22px; display: grid; grid-template-columns: 320px 1fr; gap: 28px; background: var(--panel); }

.card-visual {
  background: linear-gradient(135deg, #1e40af, #312e81);
  color: #fff;
  padding: 22px;
  border-radius: 14px;
  height: 190px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 12px 28px -12px rgba(59, 130, 246, 0.5);
}
.card-visual-brand { font-weight: 700; letter-spacing: 0.04em; }
.card-visual-number {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 17px; letter-spacing: 0.1em;
}
.card-visual-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 0.08em; }
.card-locked-pill {
  background: rgba(255,255,255,0.18);
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 700;
}
.card-locked-pill.locked { background: #fecaca; color: #991b1b; }

.card-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

.card-activity-panel {
  overflow: hidden;
}
.card-activity-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.card-activity-summary > div {
  background: #fff;
  padding: 14px 18px;
  display: grid;
  gap: 4px;
}
.summary-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.card-activity-summary strong {
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.card-tx-list {
  list-style: none;
}
.card-tx-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 110px 90px;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.card-tx-list li:last-child { border-bottom: none; }
.card-tx-empty {
  grid-template-columns: 1fr !important;
  color: var(--muted);
  font-size: 13px;
}
.card-tx-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #3730a3;
  font-size: 13px;
  font-weight: 800;
}
.card-tx-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.card-tx-main strong {
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-tx-main span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-tx-iban {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
}
.card-tx-side {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.card-tx-date {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.card-tx-amt {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card-tx-amt.neg { color: var(--ink); }
.card-tx-amt.pos { color: var(--ok); }

.btn-primary, .btn-secondary {
  cursor: pointer; font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-radius: 8px; border: none;
  transition: background 0.12s;
}
.btn-primary { background: var(--accent-2); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--border-2);
}
.btn-secondary:hover:not(:disabled) { background: var(--panel-soft); }
.btn-secondary:disabled { color: #94a3b8; cursor: not-allowed; }

/* Chat dock */
.dock {
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
}

.dock-hdr {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dock-hdr-left { display: flex; align-items: center; gap: 10px; }
.dock-title { font-weight: 700; font-size: 14px; }
.dock-sub { font-size: 11px; color: var(--ok); margin-top: 2px; }
.dock-icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.dock-icon-btn:hover { background: var(--panel-soft); }

.thread-sidebar {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
  max-height: 220px;
  overflow-y: auto;
}
.dock.threads-open .thread-sidebar { display: block; }
.thread-sidebar-hdr {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 14px 6px;
}
.thread-list { display: flex; flex-direction: column; padding: 0 8px 8px; gap: 2px; }
.thread-empty { padding: 12px 14px; color: var(--muted); font-size: 12px; }
.thread-row {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}
.thread-row:hover { background: #fff; }
.thread-row.active { background: #fff; border-color: var(--border); }
.thread-row.hidden-thread { opacity: 0.55; }
.thread-body { flex: 1; min-width: 0; cursor: pointer; }
.thread-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.thread-rename-input {
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
}
.thread-rename-input:focus { border-color: var(--accent-2); }
.thread-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}
.thread-row:hover .thread-actions,
.thread-row.active .thread-actions { opacity: 1; }
.thread-act {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.thread-act:hover { background: var(--panel-soft); color: var(--text); }
.thread-show-hidden {
  margin: 6px 4px 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  text-align: left;
}
.thread-show-hidden:hover { color: var(--text); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel-soft);
}
.chat-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-msg.user {
  background: var(--accent-2); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  background: #fff; border: 1px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.chat-msg.sys {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-form {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.chat-form input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  outline: none;
}
.chat-form input:focus { border-color: var(--accent-2); }
.chat-form button {
  background: var(--accent-2); color: #fff;
  border: none; border-radius: 8px;
  padding: 0 16px; font-weight: 600; cursor: pointer;
}

/* Brief panels in Support view */
.brief-body {
  padding: 16px 18px;
}
.brief-body p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}
.brief-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.brief-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  padding-left: 16px;
  position: relative;
}
.brief-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}
.brief-list code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent-2);
}
.brief-hint {
  border-left: 3px solid var(--accent-2);
}
.brief-hint .brief-body {
  font-size: 13px;
  color: var(--ink-2);
}

/* ============================================================
   Form primitives (used by Move money + admin-style panels)
   ============================================================ */
.panel-body { padding: 18px; }

.form-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 200px) auto auto;
  gap: 14px;
  align-items: end;
}
.transfer-form {
  grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1fr) minmax(120px, 150px);
  align-items: start;
}
.form-row .form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 23px;
}
.transfer-form .form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 0;
}
.transfer-form .form-actions .btn-primary,
.transfer-form .form-actions .btn-secondary {
  min-height: 38px;
  white-space: nowrap;
}
.form-row .form-help {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  margin-top: -4px;
}
@media (max-width: 880px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row .form-actions { flex-wrap: wrap; padding-top: 0; }
  .transfer-form .form-actions { justify-content: flex-start; }
}

.form-field { display: flex; flex-direction: column; gap: 6px; }
.beneficiary-field { position: relative; }
.form-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-field input, .form-field select, .form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  font-variant-numeric: tabular-nums;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-field input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.form-field input::placeholder { color: #94a3b8; }
.beneficiary-combobox { position: relative; }
.beneficiary-combobox input { width: 100%; }
.beneficiary-options {
  position: absolute;
  z-index: 200;
  top: calc(100% + 6px);
  left: 0;
  width: min(360px, calc(100vw - 48px));
  max-height: min(320px, 55vh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.35);
  padding: 6px;
}
.beneficiary-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 3px;
}
.beneficiary-option:hover,
.beneficiary-option:focus {
  background: var(--panel-soft);
  outline: none;
}
.beneficiary-option strong {
  font-size: 13px;
  font-weight: 700;
}
.beneficiary-option span {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.iban-field input {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
.form-status.ok  { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* Toast notifications */
.toast-stack {
  position: fixed;
  z-index: 1000;
  right: 380px;
  top: 20px;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px -22px rgba(15, 23, 42, 0.5), 0 2px 8px rgba(15, 23, 42, 0.08);
  animation: toast-in 180ms ease-out;
}
.toast.leaving {
  animation: toast-out 180ms ease-in forwards;
}
.toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--accent-2);
}
.toast.success .toast-dot { background: var(--ok); }
.toast.error .toast-dot { background: var(--danger); }
.toast.info .toast-dot { background: var(--accent-2); }
.toast-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.toast-copy strong {
  color: var(--ink);
  font-size: 13px;
}
.toast-copy span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
}
.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.toast-close:hover { color: var(--ink); }

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

@media (max-width: 1180px) {
  .toast-stack { right: 24px; }
}
@media (max-width: 760px) {
  .tx-list li {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .card-activity-summary {
    grid-template-columns: 1fr;
  }
  .card-tx-list li {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
  .card-tx-side {
    grid-column: 2 / 3;
    display: flex;
    gap: 8px;
  }
  .card-tx-amt {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
  }
  .tx-date {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
  }
  .tx-status { justify-self: start; }
  .toast-stack {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* ============================================================
   Detail list (Account & Card detail panels)
   ============================================================ */
.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.detail-list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.detail-list li:last-child { border-bottom: none; }
.detail-list .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.detail-list .value { color: var(--ink); }
.detail-list .value.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.detail-list .value .footnote {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

/* Quick-card alignment when used inside Account view */
.quick-card .quick-line .mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

/* Card actions row reflows nicely with the new buttons */
.card-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.card-actions > .card-meta {
  flex-basis: 100%;
  margin-top: 4px;
}

/* View toggling */
.view[hidden] { display: none; }

/* Scrollbars */
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }

/* ── Chat loading animation (spec 005, FR-028 / FR-029) ─────────────
   Three-dot CSS-only pulse displayed during tool-call rounds, before
   the model emits its first chunk of streamed text. No JS animation
   library; staggered animation-delay produces the typing-indicator look.
*/
.chat-msg.bot.loading {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 18px;
  padding: 8px 14px;
}
.chat-msg.bot.loading .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: three-dot-pulse 1.4s infinite;
}
.chat-msg.bot.loading .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-msg.bot.loading .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes three-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1.0; transform: translateY(-2px); }
}

/* ── No-session lockout (no valid token) ────────────────────────────
   Triggered when /api/redeem fails. Hides the entire app shell — nav,
   views, assistant panel — so no API surface, brief content, card
   actions, or chat history leak to an unauthenticated page. The banner
   is prepended to <body> by app.js and styled to fill the viewport.
*/
body.no-session > *:not(#no-session-banner):not(#toast-stack) {
  display: none !important;
}
body.no-session {
  background: #f1f5f9;
}
.no-session-banner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  z-index: 9000;
  padding: 24px;
}
.no-session-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px 36px;
  max-width: 520px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  text-align: center;
}
.no-session-card h1 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: #0f172a;
}
.no-session-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}
