/* TMF Realtime — visual language ported from TMF CRM Legal OS:
   light glassmorphism, navy brand #1a3a5c, Inter, spring easing,
   inset-highlight shadows, hover lift + press scale. */

:root {
  --brand: #1a3a5c;
  --brand-950: #102a43;
  --brand-800: #243b53;
  --brand-700: #334e68;
  --brand-600: #486581;
  --brand-500: #627d98;
  --brand-300: #9fb3c8;
  --brand-200: #bcccdc;
  --brand-100: #d9e2ec;
  --brand-50: #f0f4f8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --text: var(--brand-950);
  --text-dim: var(--brand-500);
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; height: 100dvh; }

body {
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 13px;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(188, 204, 220, 0.55) 0%, transparent 60%),
    radial-gradient(800px 640px at 105% 12%, rgba(159, 179, 200, 0.5) 0%, transparent 55%),
    radial-gradient(720px 720px at 50% 118%, rgba(217, 226, 236, 0.9) 0%, transparent 60%),
    linear-gradient(180deg, #fbfdff 0%, var(--brand-50) 100%);
}

#t-body, .bubble { -webkit-user-select: text; user-select: text; }

#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }

/* ---------- Top bar ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  margin: max(12px, env(safe-area-inset-top)) 14px 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--glass-shadow);
  z-index: 5;
  animation: fade-in-up 0.5s var(--spring);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-800), var(--brand));
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(26, 58, 92, 0.3);
}
.brand .mark svg { width: 17px; height: 17px; }
.brand h1 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--brand-950); }
.brand h1 span { color: var(--brand-500); font-weight: 500; }
.brand .tag {
  font-size: 11px; color: var(--brand-600);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px; padding: 3px 10px;
  margin-left: 4px;
}
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--brand-600); cursor: pointer;
  transition: all 0.18s var(--spring);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.03);
}
.icon-btn:hover {
  color: var(--brand-800);
  background: rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 4px 12px rgba(16, 24, 40, 0.08);
}
.icon-btn:active { transform: scale(0.97); }
.icon-btn.active {
  color: #fff; background: rgba(26, 58, 92, 0.92);
  border-color: rgba(26, 58, 92, 0.5);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(26, 58, 92, 0.25);
}
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- Stage ---------- */
#stage { position: relative; flex: 1; display: flex; min-height: 0; }
#orb-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; min-width: 0;
}
#orb { width: min(60vmin, 460px); height: min(60vmin, 460px); }
#status-line {
  margin-top: -6px; height: 24px;
  font-size: 13.5px; color: var(--text-dim);
  letter-spacing: 0.01em; text-align: center;
  transition: color 0.3s;
  font-weight: 500;
}
#status-line.speaking { color: #b45309; }
#status-line.listening { color: #0f766e; }
#status-line.thinking { color: #6d28d9; }

#conn {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; padding: 4px 12px; border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-border); color: var(--brand-600);
  display: flex; align-items: center; gap: 6px;
  box-shadow: var(--glass-shadow);
}
#conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
#conn.live .dot { background: var(--success); animation: pulse-soft 2s infinite; }

/* ---------- Transcript drawer ---------- */
#transcript {
  width: 0; overflow: hidden;
  transition: width 0.25s var(--spring);
  display: flex; flex-direction: column;
  margin: 10px 0;
  border-radius: 16px 0 0 16px;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-right: none;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 16px 40px rgba(16, 24, 40, 0.1);
}
#transcript.open { width: min(420px, 42vw); }
#transcript .t-head {
  padding: 14px 18px; font-size: 11px; font-weight: 600;
  color: var(--brand-500); text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(26, 58, 92, 0.08);
  display: flex; justify-content: space-between; align-items: center;
}
.t-actions { display: flex; align-items: center; gap: 12px; }
#t-clear {
  font-size: 11px; color: var(--brand-400, var(--brand-500)); cursor: pointer;
  background: none; border: none; font-family: inherit;
  transition: color 0.18s var(--spring);
}
#t-clear:hover { color: var(--danger); }
#t-close {
  display: none; /* mobile only */
  width: 28px; height: 28px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--brand-600); cursor: pointer; place-items: center;
}
#t-close svg { width: 15px; height: 15px; }
#t-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 88%; padding: 9px 13px; border-radius: 14px;
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word;
  animation: fade-in-up 0.35s var(--spring);
}
.bubble.user {
  align-self: flex-end;
  background: rgba(26, 58, 92, 0.92);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 2px 8px rgba(26, 58, 92, 0.22);
}
.bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--brand-950);
  border-bottom-left-radius: 5px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.03);
}
.bubble.interim { opacity: 0.55; font-style: italic; }
.bubble .cut { color: var(--text-dim); font-size: 11px; font-style: italic; margin-top: 2px; }

/* tool activity chip */
.tool-chip {
  align-self: center;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; color: var(--brand-600);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px; padding: 4px 12px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.03);
  animation: fade-in-up 0.3s var(--spring);
}
.tool-chip .spin {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--brand-200);
  border-top-color: var(--brand-700);
  animation: spin 0.8s linear infinite;
}
.tool-chip.ok .spin { display: none; }
.tool-chip.ok::before { content: "✓"; color: var(--success); font-weight: 700; }
.tool-chip.err::before { content: "!"; color: var(--danger); font-weight: 700; }
.tool-chip.err .spin { display: none; }
a.tool-chip.phone-go {
  text-decoration: none; cursor: pointer;
  color: #fff; background: rgba(26, 58, 92, 0.92);
  border-color: rgba(26, 58, 92, 0.4);
  font-weight: 600; padding: 8px 16px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 2px 10px rgba(26, 58, 92, 0.25);
}
a.tool-chip.phone-go:active { transform: scale(0.97); }

/* preview cards (Siri-style) */
.cards { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.card {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.03),
    0 4px 12px rgba(0, 0, 0, 0.04);
  text-decoration: none; color: inherit;
  transition: all 0.18s var(--spring);
  animation: fade-in-up 0.35s var(--spring);
}
.card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 6px 18px rgba(16, 24, 40, 0.1);
}
.card:active { transform: scale(0.98); }
.card-fav {
  width: 28px; height: 28px; border-radius: 8px; margin-top: 2px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(26, 58, 92, 0.08);
  padding: 4px; flex: none;
}
.card-body { min-width: 0; }
.card-title {
  font-size: 12.5px; font-weight: 600; color: var(--brand-950);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-snippet {
  font-size: 11.5px; color: var(--brand-600); line-height: 1.45; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 10.5px; color: var(--brand-500); margin-top: 4px; letter-spacing: 0.02em; }

/* ---------- Bottom controls ---------- */
#controls {
  display: flex; align-items: center; justify-content: center;
  gap: 24px;
  padding: 16px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 5;
}
.ctl {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  color: var(--brand-700);
  transition: all 0.18s var(--spring);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65), 0 2px 6px rgba(16, 24, 40, 0.06);
}
.ctl svg { width: 23px; height: 23px; }
.ctl:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.75), 0 8px 20px rgba(16, 24, 40, 0.1);
}
.ctl:active { transform: scale(0.97); }
.ctl.mute.muted { background: var(--brand-950); color: #fff; border-color: var(--brand-800); }
.ctl.end { color: var(--danger); }
.ctl.end:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.ctl.start {
  width: 74px; height: 74px;
  background: linear-gradient(150deg, var(--brand-700), var(--brand) 55%, var(--brand-950));
  border: none; color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(26, 58, 92, 0.3),
    0 12px 36px rgba(26, 58, 92, 0.35);
}
.ctl.start:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 6px 16px rgba(26, 58, 92, 0.35),
    0 16px 44px rgba(26, 58, 92, 0.42);
}
.ctl[disabled] { opacity: 0.35; pointer-events: none; }

/* ---------- Settings drawer ---------- */
#settings {
  position: absolute; top: 8px; right: 14px; width: 320px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 18px; z-index: 20;
  display: none; flex-direction: column; gap: 13px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 24px 60px rgba(16, 24, 40, 0.14);
}
#settings.open { display: flex; animation: scale-in 0.3s var(--spring); }
#settings h3 {
  font-size: 11px; color: var(--brand-500);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--brand-600); font-weight: 500; }
.field select {
  background: rgba(255, 255, 255, 0.65);
  color: var(--brand-950);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 8px 10px; font-size: 13px; outline: none;
  font-family: inherit;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.18s var(--spring);
}
.field select:focus { border-color: var(--brand-300); box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.12); }
.seg {
  display: flex;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
.seg button {
  flex: 1; padding: 7px 0; font-size: 12px; background: none; border: none;
  color: var(--brand-500); cursor: pointer; font-family: inherit; font-weight: 500;
  transition: all 0.18s var(--spring);
}
.seg button:hover { color: var(--brand-800); }
.seg button.on {
  background: rgba(26, 58, 92, 0.92); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.hint { font-size: 11px; color: var(--brand-500); line-height: 1.45; }

/* ---------- Latency HUD ---------- */
#hud {
  position: absolute; left: 16px; bottom: 14px;
  font-size: 11px; color: var(--brand-500);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 9px 14px;
  display: none; gap: 14px; z-index: 6;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--glass-shadow);
}
#hud.open { display: flex; animation: fade-in-up 0.3s var(--spring); }
#hud b { color: var(--brand-900, var(--brand-950)); font-weight: 600; }
#hud .lat-good { color: #15803d; }
#hud .lat-mid { color: #b45309; }
#hud .lat-bad { color: var(--danger); }

/* ---------- Toast ---------- */
#toast {
  position: absolute; bottom: 104px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: var(--brand-900, var(--brand-950));
  padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 30;
  max-width: 80vw; text-align: center;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.12);
}
#toast.show { opacity: 1; }

/* ---------- Animations ---------- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--brand-200); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 720px) {
  /* compact glass header that respects the notch */
  header {
    margin: max(8px, env(safe-area-inset-top)) 8px 0;
    padding: 8px 10px;
    border-radius: 14px;
  }
  .brand { gap: 8px; }
  .brand .mark { width: 28px; height: 28px; border-radius: 9px; }
  .brand .mark svg { width: 15px; height: 15px; }
  .brand h1 { font-size: 13px; }
  .brand .tag { display: none; }
  .icon-btn { width: 34px; height: 34px; border-radius: 11px; }

  /* orb sized against the dynamic viewport so controls never clip */
  #orb { width: min(82vmin, 44dvh); height: min(82vmin, 44dvh); }
  #status-line { font-size: 13px; padding: 0 18px; }
  #conn { top: 6px; }

  /* transcript becomes a full-screen sheet with its own close button */
  #transcript { transition: none; }
  #transcript.open {
    position: absolute; inset: 0;
    width: 100%; z-index: 15;
    border-radius: 0; margin: 0; border: none;
    background: rgba(247, 250, 253, 0.92);
    animation: fade-in-up 0.25s var(--spring);
  }
  #transcript .t-head { padding-top: max(14px, env(safe-area-inset-top)); }
  #t-close { display: grid; }
  #t-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .bubble { max-width: 92%; font-size: 14px; }

  /* settings becomes a bottom sheet */
  #settings {
    position: fixed; left: 8px; right: 8px; width: auto;
    top: auto; bottom: calc(8px + env(safe-area-inset-bottom));
    max-height: 72dvh; overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 -8px 40px rgba(16, 24, 40, 0.18), 0 1px 3px rgba(16, 24, 40, 0.06);
    z-index: 25;
  }
  #settings.open { animation: sheet-up 0.3s var(--spring); }
  .field select { padding: 11px 12px; font-size: 15px; } /* ≥16px avoids iOS zoom-on-focus; 15 + user-scalable=no is fine */
  .seg button { padding: 11px 0; font-size: 13px; }

  /* controls: thumb-sized, clear of the home indicator */
  #controls { gap: 22px; padding: 10px 0 calc(18px + env(safe-area-inset-bottom, 8px)); }
  .ctl { width: 58px; height: 58px; }
  .ctl.start { width: 74px; height: 74px; }

  /* HUD + toast float above the controls, centered */
  #hud {
    left: 50%; transform: translateX(-50%);
    bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    gap: 10px; font-size: 10px; padding: 7px 11px; white-space: nowrap;
  }
  #toast { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); max-width: 92vw; }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Access gate ---------- */
#login {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background:
    radial-gradient(800px 600px at 50% 20%, rgba(188, 204, 220, 0.5) 0%, transparent 60%),
    linear-gradient(180deg, #fbfdff 0%, var(--brand-50) 100%);
  padding: 20px;
}
#login.open { display: flex; }
.login-card {
  width: min(360px, 92vw);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 24px 60px rgba(16, 24, 40, 0.14);
  animation: scale-in 0.3s var(--spring);
}
.login-mark {
  width: 52px; height: 52px; border-radius: 15px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-800), var(--brand));
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 14px rgba(26, 58, 92, 0.3);
}
.login-mark svg { width: 26px; height: 26px; }
.login-card h2 { font-size: 17px; font-weight: 600; color: var(--brand-950); }
.login-card p { font-size: 12.5px; color: var(--brand-500); margin: 4px 0 18px; }
#login-pw {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border-radius: 12px; outline: none; font-family: inherit;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: var(--brand-950); text-align: center;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.03);
}
#login-pw:focus { border-color: var(--brand-300); box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.12); }
#login-go {
  width: 100%; margin-top: 12px; padding: 12px 0;
  border: none; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: #fff; background: rgba(26, 58, 92, 0.92);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 4px 12px rgba(26, 58, 92, 0.25);
  transition: all 0.18s var(--spring);
}
#login-go:hover { background: var(--brand); transform: translateY(-1px); }
#login-go:active { transform: scale(0.97); }
#login-err { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--danger); font-weight: 500; }

/* ---------- Microsoft sign-in + account ---------- */
.ms-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 0; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--brand-950); background: #fff;
  border: 1px solid rgba(26, 58, 92, 0.18);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.06);
  transition: all 0.18s var(--spring);
}
.ms-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 24, 40, 0.1); }
.ms-btn:active { transform: scale(0.98); }
#login-or {
  margin: 14px 0 12px; font-size: 11px; color: var(--brand-400, var(--brand-500));
  text-transform: uppercase; letter-spacing: 0.1em; position: relative;
}
#acct-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#acct-id {
  font-size: 13px; font-weight: 600; color: var(--brand-950);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
#btn-logout {
  flex: none; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit;
  color: var(--brand-700); background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 9px; padding: 7px 12px;
  transition: all 0.18s var(--spring);
}
#btn-logout:hover { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
#btn-logout:active { transform: scale(0.97); }
