/* Warden demo app — chat product UI. Reuses style.css's color/type tokens
   so it stays visually consistent with the marketing site, but these
   components are specific to the chat surface. */

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 76px);
}

.demo-banner {
  grid-column: 1 / -1;
  background: var(--bg-panel-raised);
  border-bottom: 1px solid var(--border-strong);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-soft);
}
.demo-banner .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-soft);
  flex-shrink: 0;
}

/* Wallet connect gate + connected state */
.connect-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 10px;
}
.connect-options .btn {
  width: 100%;
}
.gate-copy {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.gate-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  opacity: 0.8;
  line-height: 1.4;
  margin: 0;
}
.connected-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.connected-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.connected-address {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}
.disconnect-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.disconnect-link:hover { color: var(--warn); }

/* Wallet sidebar */
.wallet-panel {
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  background: var(--bg-panel);
  overflow-y: auto;
}
.sidebar-section {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.wallet-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.sidebar-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 8px;
}
.wallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.wallet-row:first-child { border-top: none; padding-top: 0; }
.wallet-row:hover .wallet-ticker { color: var(--accent-soft); }
.wallet-row .wallet-ticker,
.wallet-row .wallet-note {
  display: block;
}
.wallet-ticker {
  font-weight: 600;
  color: var(--text);
}
.wallet-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}

/* Recent alerts */
.alert-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.alert-row:first-child { border-top: none; padding-top: 0; }
.alert-row:hover .alert-label { color: var(--accent-soft); }
.alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--accent-soft);
}
.alert-row.warn .alert-dot { background: var(--warn); }
.alert-row > div { flex: 1; min-width: 0; }
.alert-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.alert-detail {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Guard limit card */
.guard-limit-card {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px;
}
.guard-limit-amount-prefix {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-soft);
}
.guard-limit-input {
  width: 90px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-soft);
  background: none;
  border: none;
  border-bottom: 1px dashed var(--border-strong);
  padding: 0 0 2px;
}
.guard-limit-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.guard-limit-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 6px;
}
.guard-limit-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 10px;
}

.external-icon {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Resources — links out to the marketing site's real pages, new tab */
.resource-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.resource-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.resource-links a:hover {
  background: var(--bg-panel-raised);
  color: var(--accent-soft);
}
.resource-links a .external-icon { opacity: 0.6; }
.resource-links a:hover .external-icon { opacity: 1; }

/* Chat column */
.chat-column {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 76px - 45px);
}
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.warden { justify-content: flex-start; }
.bubble {
  max-width: 66%;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-line;
}
.bubble.user {
  background: var(--accent);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}
.bubble.warden {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.bubble.warden.alert { border-color: rgba(141, 255, 176, 0.4); }
.bubble.warden.guard-decline { border-color: rgba(255, 92, 92, 0.4); color: var(--warn); }
.bubble.warden.guard-approve { border-color: var(--accent-soft); color: var(--accent-soft); }

.bubble.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 16px 18px;
}
.bubble.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble.typing span { animation: none; opacity: 0.8; }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 32px 16px;
}
.suggestion-chip {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
}
.suggestion-chip:hover { border-color: var(--accent-soft); color: var(--accent-soft); }

.chat-form {
  display: flex;
  gap: 12px;
  padding: 18px 32px;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 14px 20px;
  color: var(--text);
  font-size: 0.96rem;
  font-family: var(--font-body);
}
.chat-form input::placeholder { color: var(--text-muted); }
.chat-form input:focus { border-color: var(--accent); }
.chat-form button {
  flex-shrink: 0;
}

@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .wallet-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .bubble { max-width: 84%; }
  .chat-thread, .chat-suggestions, .chat-form { padding-left: 18px; padding-right: 18px; }
}
