/* ---------- SimbaChat — Red Mane Property Coach ---------- */

:root {
  --bg: #161c3e;
  --bg-2: #0F0F12;
  --surface: #14141A;
  --surface-2: #1B1B22;
  --line: rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.12);
  --text: #F4F4F6;
  --text-dim: #A1A1A9;
  --text-faint: #6E6E78;

  --crimson: #eb2428;
  --crimson-strong: oklch(0.56 0.24 25);
  --crimson-glow: oklch(0.62 0.21 25 / 0.35);
  --crimson-soft: oklch(0.62 0.21 25 / 0.12);

  --glass: rgba(255,255,255,0.035);
  --glass-strong: rgba(255,255,255,0.06);
  --glass-blur: 18px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 20px 60px -20px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.05) inset;

  --gutter: 24px;
  --density: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button { font-family: inherit; }

/* ---------- App shell ---------- */

.app {
  display: block;
  height: 100vh;
  /* background:
    radial-gradient(1200px 800px at 75% 10%, oklch(0.62 0.21 25 / 0.06), transparent 60%),
    radial-gradient(900px 700px at 10% 100%, oklch(0.62 0.21 25 / 0.04), transparent 55%),
    var(--bg); */
}
.chat { height: 100vh; }

/* ---------- Sidebar ---------- */

.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, oklch(0.7 0.22 25), oklch(0.45 0.2 22));
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 20px -8px var(--crimson-glow);
  position: relative;
  overflow: hidden;
}
.brand-mark svg { width: 26px; height: 26px; color: #fff; }
.brand-name {
  font-family: "Montserrat", "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 0.2px;
  line-height: 1;
}
.brand-name em { font-style: italic; color: var(--crimson); }
.brand-sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 4px;
}
.loginLogo{
  width: 200px;
  margin: 0 auto 16px auto;
  display: block;
}
.headerLogo{
  width: 200px;
}
.new-chat {
  margin: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: all .15s ease;
}
.new-chat:hover {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.2);
}
.new-chat .plus {
  width: 18px; height: 18px;
  border-radius: 6px;
  background: var(--crimson);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
}

.sidebar-section {
  padding: 6px 22px 8px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 6px;
}

.history {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.history::-webkit-scrollbar { width: 6px; }
.history::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.history-item {
  display: flex; flex-direction: column;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all .12s ease;
  position: relative;
}
.history-item:hover {
  background: var(--surface);
  color: var(--text);
}
.history-item.active {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
.history-item.active::before {
  content: "";
  position: absolute;
  left: -2px; top: 10px; bottom: 10px;
  width: 2px;
  background: var(--crimson);
  border-radius: 2px;
}
.history-item .title {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item .meta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.user-tile {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2a2a31, #1a1a1f);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .n {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-meta .e {
  font-size: 11px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cog {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-dim);
  cursor: pointer;
  border: 1px solid transparent;
}
.cog:hover { color: var(--text); background: var(--surface); border-color: var(--line-strong); }

/* ---------- Main chat column ---------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.chat-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: #141b3e;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.chat-title {
  display: flex; align-items: center; gap: 14px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: oklch(0.78 0.18 145);
  box-shadow: 0 0 12px oklch(0.78 0.18 145 / 0.6);
}
.chat-title h1 {
  font-family: "Montserrat", serif;
  font-size: 22px;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.2px;
}
.chat-title .sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

.chat-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s ease;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}
.pill-btn {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.pill-btn:hover { background: var(--surface-2); }
.pill-btn.primary {
  background: var(--crimson);
  color: #fff;
  border-color: transparent;
}
.pill-btn.primary:hover { background: var(--crimson-strong); }

/* ---------- Stream / messages ---------- */

.stream-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.watermark {
  position: absolute;
  left: 0;
  display: none; /* grid */
  place-items: center;
  pointer-events: none;
  z-index: 0;
}
.watermark img {
  width: auto;
  height: 100vh;
  opacity: var(--lion-opacity, 0.07);
  filter: drop-shadow(0 0 60px oklch(0.62 0.21 25 / 0.25));
}

.stream {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  scroll-behavior: smooth;
  padding: 36px 28px 220px;
}
.stream::-webkit-scrollbar { width: 8px; }
.stream::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }

.stream-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: calc(28px * var(--density));
}

/* ----- Message rows ----- */

.msg {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: flex-start;
}
.msg.user { grid-template-columns: 1fr 36px; }
.msg.user .bubble-col { align-items: flex-end; }

.msg-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
}
.msg-av.bot {
  background: transparent;
  /*box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 24px -10px var(--crimson-glow);*/
  box-shadow: none;
  border: none;
}
.msg-av.bot img { width: 36px;}
.msg-av.user {
  background: linear-gradient(135deg, #2a2a31, #1a1a1f);
  font-size: 12px; font-weight: 600;
}

.bubble-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bubble-meta {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  display: flex; gap: 8px; align-items: center;
}
.bubble-meta .who { color: var(--text-dim); font-weight: 500; }
.bubble-meta .who.bot { color: oklch(0.72 0.18 25); }
.bubble-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }

.bubble {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: calc(14px * var(--density)) 18px;
  border-radius: var(--r-lg);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  max-width: 640px;
  position: relative;
  box-shadow: var(--shadow-1);
}
.bubble.bot {
  border-top-left-radius: 6px;
}
.bubble.user {
  background: linear-gradient(180deg, oklch(0.62 0.21 25 / 0.95), oklch(0.55 0.22 25 / 0.95));
  border-color: oklch(0.7 0.2 25 / 0.4);
  color: #fff;
  border-top-right-radius: 6px;
  box-shadow: 0 12px 30px -12px var(--crimson-glow), var(--shadow-1);
}
.bubble p { margin: 0 0 10px; }
.bubble p:last-child { margin: 0; }
.bubble strong { color: #fff; font-weight: 600; }
.bubble em.accent { color: oklch(0.78 0.16 25); font-style: normal; font-weight: 500; }

.bubble ul {
  margin: 8px 0 0;
  padding: 0 0 0 18px;
}
.bubble ul li { margin-bottom: 4px; }

/* citation cards */
.cites {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  max-width: 640px;
}
.cite {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  backdrop-filter: blur(var(--glass-blur));
}
.cite:hover {
  background: var(--glass-strong);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.cite-thumb {
  width: 56px; height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, #4a1d39, #ec2528);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: rgba(255,255,255,0.7);
}
.cite-thumb::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 6px, transparent 6px 12px);
}
.cite-thumb .play {
  position: relative;
  width: 0; height: 0;
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 2px;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.4));
}
.cite-body { min-width: 0; }
.cite-title {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 9px;
}
.cite-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
  display: flex; gap: 8px; align-items: center;
}
.cite-meta .session { color: oklch(0.75 0.15 25); font-weight: 500; }
.cite-ts {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
  width: fit-width;
}
.timestamp-wrapper{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* bot bubble actions */
.bubble-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  opacity: 0.5;
  transition: opacity .15s ease;
}
.bubble-col:hover .bubble-actions { opacity: 1; }
.bubble-action {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  display: inline-flex; align-items: center; gap: 4px;
}
.bubble-action:hover { color: var(--text); background: var(--surface); }

/* typing indicator */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}
.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: oklch(0.72 0.18 25);
  animation: bounce 1.1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.searching {
  font-size: 12px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.searching .scan{
  width: 14px; height: 14px;
  border: 1.5px solid transparent;
  border-top-color: oklch(0.72 0.18 25);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.searching_citations {
  font-size: 12px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  width: 640px;
  max-width: 100%;
}
.searching_citations .scan_cites{
  width: 14px; height: 14px;
  border: 1.5px solid transparent;
  border-top-color: oklch(0.72 0.18 25);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;

}

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

/* ---------- Hero (empty state) ---------- */

.hero {
  max-width: 760px;
  margin: 6vh auto 0;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-kicker::before, .hero-kicker::after {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--crimson), transparent);
}
.hero h2 {
  font-family: "Montserrat", serif;
  font-weight: 400;
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.04;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.hero h2 em {
  font-style: italic;
  color: var(--crimson);
}
.hero p {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0 auto 36px;
  max-width: 540px;
}

.suggest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
  text-align: left;
}
.suggest {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  transition: all .18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.suggest:hover {
  background: var(--glass-strong);
  border-color: var(--crimson);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--crimson-glow);
}
.suggest .tag {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crimson);
  font-weight: 600; 
}
.suggest .q {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

/* ---------- Composer ---------- */

.composer-wrap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 28px 26px;
  z-index: 6;
  /* background: linear-gradient(180deg, transparent, rgba(10,10,11,0.85) 30%, var(--bg)); */
  background: var(--bg);
  pointer-events: none;
}
.composer-inner {
  max-width: 820px;
  margin: 0 auto;
  pointer-events: auto;
}
.composer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-2);
  transition: border-color .15s ease;
}
.composer:focus-within {
  border-color: oklch(0.62 0.21 25 / 0.7);
  box-shadow: 0 0 0 4px oklch(0.62 0.21 25 / 0.1), var(--shadow-2);
}
.composer textarea {
  background: transparent;
  border: none;
  outline: none;
  color: var(--bg);
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 4px;
  max-height: 200px;
  min-height: 24px;
}
.composer textarea::placeholder { color: var(--text-faint); }

.composer-tool {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  display: grid; place-items: center;
}
.composer-tool:hover { color: var(--text); background: var(--surface); }

.composer-send {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--crimson);
  border: none;
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 6px 16px -6px var(--crimson-glow);
}
.composer-send:hover:not(:disabled) {
  background: var(--crimson-strong);
  transform: translateY(-1px);
}
.composer-send:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}

.composer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-faint);
  padding: 0 4px;
}
.composer-bar .left { display: flex; gap: 14px; align-items: center; }
.composer-bar kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.corpus-meta {
  display: inline-flex; align-items: center; gap: 6px;
}
.corpus-meta .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(0.78 0.18 145);
  box-shadow: 0 0 8px oklch(0.78 0.18 145 / 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- Inline source pills inside bot text ---------- */
.src-ref {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: oklch(0.62 0.21 25 / 0.15);
  color: oklch(0.78 0.16 25);
  border: 1px solid oklch(0.62 0.21 25 / 0.3);
  margin: 0 2px;
  vertical-align: 2px;
  cursor: pointer;
  text-decoration: none;
}
.src-ref:hover { background: oklch(0.62 0.21 25 / 0.25); }

/* ---------- Tweaks integration overrides ---------- */
.tweaks-panel {
  font-family: "Montserrat", sans-serif;
}

/* ---------- Login ---------- */

.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
  background:
    radial-gradient(900px 700px at 70% 20%, oklch(0.62 0.21 25 / 0.10), transparent 60%),
    radial-gradient(800px 600px at 20% 90%, oklch(0.62 0.21 25 / 0.06), transparent 55%),
    var(--bg);
  overflow: hidden;
}
.login-watermark {
  position: absolute;
  left: 0;
  display: grid; /* grid */
  place-items: center;
  pointer-events: none;
}
.login-watermark img {
  opacity: 0.1;
  filter: drop-shadow(0 0 80px oklch(0.62 0.21 25 / 0.3));
  height: 100vh;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 40px));
  padding: 40px 36px 32px;
  background: rgba(20,20,26,0.7);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.7),
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 0 0 1px rgba(255,255,255,0.02);
}
.login-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, oklch(0.7 0.22 25), oklch(0.4 0.18 22));
  display: grid; place-items: center;
  margin: 0 auto 22px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 16px 36px -12px var(--crimson-glow);
}
.login-mark svg { width: 34px; height: 34px; color: #fff; }

.login-title {
  font-family: "Montserrat", serif;
  font-size: 36px;
  font-weight: 400;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: 0.2px;
}
.login-title em { font-style: italic; color: var(--crimson); }
.login-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
  margin: 16px auto 28px;
  max-width: 320px;
}

.login-field {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(10,10,11,0.5);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: all .15s ease;
}
.login-input-wrap:focus-within {
  border-color: oklch(0.62 0.21 25 / 0.7);
  box-shadow: 0 0 0 4px oklch(0.62 0.21 25 / 0.1);
}
.login-input-wrap svg { color: var(--text-faint); flex-shrink: 0; }
.login-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.login-input-wrap input::placeholder { color: var(--text-faint); }

.login-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: oklch(0.62 0.21 25 / 0.08);
  border: 1px solid oklch(0.62 0.21 25 / 0.3);
  color: oklch(0.82 0.16 25);
  font-size: 13px;
  line-height: 1.45;
  display: flex; gap: 10px; align-items: flex-start;
  animation: msgIn 0.25s ease-out;
}
.login-error svg { flex-shrink: 0; margin-top: 1px; }

.login-cta {
  margin-top: 18px;
  width: 100%;
  padding: 14px;
  background: var(--crimson);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s ease;
  box-shadow: 0 10px 24px -8px var(--crimson-glow);
  letter-spacing: 0.01em;
}
.login-cta:hover:not(:disabled) {
  background: var(--crimson-strong);
  transform: translateY(-1px);
}
.login-cta:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}
.login-cta .scan {
  width: 14px; height: 14px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-hint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}
.login-hint code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.login-foot {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  z-index: 1;
}

/* user pill in header */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.user-pill:hover { background: var(--surface-2); border-color: var(--line-strong); }
.user-pill .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.user-pill .signout {
  color: var(--text-faint);
  font-size: 11px;
  margin-left: -4px;
  padding-right: 2px;
}

/* ---------- Animations ---------- */
.msg {
  animation: msgIn 0.35s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Tooltips for icon buttons ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  z-index: 10;
}
