/* Prichat shared theme: color tokens (light + dark), base resets, brand mark,
   buttons and toast. Used by both the landing page and the chat app. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: #15171c;
  --text-muted: #6b7280;
  --accent: #3b5bfd;
  --accent-contrast: #ffffff;
  --accent-soft: #eef1ff;
  --danger: #dc3545;
  --danger-soft: #fdecee;
  --live: #16a34a;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --warn-border: #f5d9a8;
  --bubble-mine: #3b5bfd;
  --bubble-mine-text: #ffffff;
  --bubble-other: #f1f3f6;
  --bubble-other-text: #15171c;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-subtle: #151820;
    --surface: #171a21;
    --border: #262a33;
    --text: #eceef2;
    --text-muted: #8b93a3;
    --accent: #6d86ff;
    --accent-contrast: #0f1115;
    --accent-soft: #1d2340;
    --danger: #f06272;
    --danger-soft: #3a1d22;
    --live: #34d399;
    --warn: #f5b74e;
    --warn-soft: #2e2412;
    --warn-border: #4a3a1a;
    --bubble-mine: #4c66f5;
    --bubble-mine-text: #ffffff;
    --bubble-other: #1f232c;
    --bubble-other-text: #eceef2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-muted); font-weight: 400; }


/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--accent);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px 7px 9px 7px;
  border-radius: 4px; background: var(--accent-contrast); opacity: 0.9;
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-secondary { background: var(--surface); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); }


.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 10px 16px; border-radius: 99px;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 32px); text-align: center;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
