/* Forge — ATCE IT Intelligence Platform (AlfaTech / VelaTech brand)
   Brand palette:
     AlfaTech Navy   #0E2A6E   (primary, "ALFA")
     AlfaTech Lime   #C5D632   (accent, "TECH")
     VelaTech Blue   #3E5BFC   (secondary highlight)
     Neutral greys for chrome
   Dark mode + light mode + iOS PWA support.
*/

:root {
  /* Light mode — clean, generous whitespace, Google-tier minimalism */
  --bg:          #f6f7fb;
  --surface:     #ffffff;
  --surface-2:  #f0f2f7;
  --border:      #e3e6ee;
  --text:        #0e1116;
  --text-muted:  #5b6275;
  --brand-primary:    #0E2A6E;   /* AlfaTech Navy */
  --brand-accent:     #C5D632;   /* AlfaTech Lime */
  --brand-secondary:  #3E5BFC;   /* VelaTech Blue */
  --accent:           #3E5BFC;   /* alias → brand-secondary */
  --success: #1aa463;
  --warn:    #d97706;
  --danger:  #d92d20;
  --radius:  14px;
  --radius-lg: 24px;
  --shadow:   0 1px 3px rgba(14, 42, 110, 0.04), 0 8px 24px rgba(14, 42, 110, 0.06);
  --shadow-lg: 0 4px 32px rgba(14, 42, 110, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --transition: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[data-theme="dark"],
html[data-theme="auto"] {
  /* auto = follow OS — handled by media query below */
}

html[data-theme="dark"] {
  --bg:          #0a0e16;
  --surface:     #131822;
  --surface-2:  #1c2230;
  --border:      #262d3b;
  --text:        #e6e8ee;
  --text-muted:  #8e95a8;
  --brand-primary:    #4f7cd9;   /* Lifted navy for dark-mode legibility */
  --brand-secondary:  #6c9bff;
  --accent:           #6c9bff;
  --shadow:   0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 32px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg:          #0a0e16;
    --surface:     #131822;
    --surface-2:  #1c2230;
    --border:      #262d3b;
    --text:        #e6e8ee;
    --text-muted:  #8e95a8;
    --brand-primary:    #4f7cd9;
    --brand-secondary:  #6c9bff;
    --accent:           #6c9bff;
    --shadow:   0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 32px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  min-height: 100svh;
}

/* iOS safe-area-inset support */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ---------- header (minimal on landing; Google-bar in result mode) ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  padding-top: max(14px, env(safe-area-inset-top));
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* When the search bar is visible (result mode), show a bottom border */
.app-header.result-mode {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

/* Pulse the result search bar while waiting for a response */
@keyframes search-pulse {
  0%, 100% { box-shadow: 0 1px 6px rgba(0,0,0,0.07); }
  50%       { box-shadow: 0 1px 12px color-mix(in srgb, var(--brand-primary) 30%, transparent); }
}
/* loading pulse removed — too distracting during queries */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--text-muted);
}


.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-name .forge-for { color: var(--brand-primary); }
.brand-name .forge-ge  { color: var(--brand-accent); }

.brand-wordmark {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.bw-alfa { color: var(--brand-primary); }
.bw-tech { color: var(--brand-accent); }

/* "Forge" product name — same size/weight as ALFATECH wordmark */
.brand-forge {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--brand-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;   /* pin the user/avatar chip top-right even when result mode hides the brand */
}

/* Install-as-app button — revealed by app.js only when the browser offers
   install (beforeinstallprompt) and hidden once installed / running standalone. */
.install-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 600 13px/1 inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.install-app-btn:hover  { background: var(--surface-2); border-color: var(--brand-primary); color: var(--brand-primary); }
.install-app-btn:active { transform: scale(0.97); }
.install-app-btn svg    { flex: none; }

/* Forge Assist voice settings — gear icon in the header */
.header-gear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.header-gear-btn:hover  { color: var(--brand-primary); background: var(--surface-2); }
.header-gear-btn:active { transform: scale(0.94); }

/* ── Header user avatar + dropdown ── */
.hdr-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 10px;
  transition: background 0.15s;
  user-select: none;
  position: relative;
}
.hdr-user:hover { background: var(--surface-2); }

.hdr-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.hdr-user-role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.hdr-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.hdr-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.hdr-caret {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: -6px;
}

.hdr-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 230px;
  z-index: 400;
  overflow: hidden;
}
.hdr-dd-header {
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.hdr-dd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.hdr-dd-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.hdr-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  transition: background 0.12s;
}
.hdr-dd-item:hover { background: var(--surface-2); }
.hdr-dd-item svg { color: var(--text-muted); flex-shrink: 0; }
.hdr-dd-danger { color: var(--danger) !important; }
.hdr-dd-danger svg { color: var(--danger) !important; }
.hdr-dd-div { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Profile pane ── */
.profile-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 12px;
}
.profile-preview-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-preview-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.profile-preview-name { font-size: 15px; font-weight: 600; color: var(--text); }
.profile-preview-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.profile-opts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.profile-opt-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.profile-opt-btn:hover { border-color: var(--brand-primary); }
.profile-opt-btn.active {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
}

.profile-opt-body { min-height: 80px; margin-bottom: 18px; }
.profile-opt-hint { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.profile-ms365-wrap { display: flex; align-items: center; gap: 14px; }
.profile-ms365-wrap img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }

.profile-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.profile-upload-label:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.profile-upload-preview { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.profile-upload-preview img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.profile-remove-btn {
  font-size: 12px; color: var(--danger); background: none; border: none;
  cursor: pointer; text-decoration: underline; font-family: var(--font);
}
.profile-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.profile-cam-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1.5px dashed var(--border);
  border-radius: 10px; cursor: pointer; font-size: 14px;
  color: var(--text-muted); background: var(--surface); font-family: var(--font);
  transition: border-color 0.15s, color 0.15s;
}
.profile-cam-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.profile-cam-wrap { margin-top: 14px; }
.profile-cam-video { width: 100%; max-width: 280px; border-radius: 10px; display: block; background: #000; }
.profile-cam-actions { display: flex; gap: 8px; margin-top: 10px; }
.profile-cam-capture {
  padding: 8px 16px; background: var(--brand-primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-family: var(--font);
}
.profile-cam-cancel {
  padding: 8px 16px; background: none; color: var(--text-muted);
  border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; font-family: var(--font);
}

.profile-current { margin-top: 0; }
.profile-current img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.profile-current-meta { display: flex; flex-direction: column; gap: 8px; }
.profile-current-actions { display: flex; align-items: center; gap: 14px; }
.profile-change-btn {
  padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: var(--font); transition: border-color 0.12s, color 0.12s;
}
.profile-change-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.emoji-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, background 0.12s;
  padding: 0;
}
.emoji-btn:hover { border-color: var(--brand-primary); background: var(--surface-2); }
.emoji-btn.selected { border-color: var(--brand-primary); background: var(--surface-2); box-shadow: 0 0 0 2px var(--brand-primary); }

.profile-save-status { font-size: 13px; margin-top: 8px; min-height: 18px; }
.profile-save-ok { color: var(--success); }
.profile-save-err { color: var(--danger); }

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.icon-btn:hover { background: var(--surface-2); border-color: var(--brand-primary); }
.icon-btn:active { transform: scale(0.96); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.apps-btn { color: var(--text-muted); }
.apps-btn:hover { color: var(--brand-primary); }


/* ---------- landing (Google-style) ---------- */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  min-height: calc(100svh - 200px);
  padding: 48px 24px 24px;
  text-align: center;
}

.landing-icon {
  width: 104px;
  height: 104px;
  border-radius: 22%;
  margin-bottom: 14px;
  object-fit: cover;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}

.landing-logo {
  font-size: 64px;
  letter-spacing: -0.04em;
  margin-bottom: 36px;
  line-height: 1;
}

.landing-logo .alfa {
  color: var(--brand-primary);
  font-weight: 500;
}

.landing-logo .tech {
  color: var(--brand-accent);
  font-weight: 900;
}

.landing-logo .forge {
  color: var(--brand-primary);
  font-weight: 700;
}

.landing-greeting {
  font-size: 22px;
  font-weight: 500;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin-bottom: 28px;
}

.search-shell {
  width: 100%;
  max-width: 640px;
  position: relative;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 10px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}

/* Google-style + button left of the search input */
.plus-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-right: 4px;
  padding: 0;
}
.plus-btn:hover  { color: var(--brand-primary); background: var(--surface-2); }
.plus-btn:active { transform: scale(0.93); }

/* Dropdown menu */
.plus-menu {
  position: fixed;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 248px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  overflow: hidden;
  padding: 6px 0;
}
.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.plus-menu-item:hover  { background: var(--surface-2); }
.plus-menu-item svg    { color: var(--text-muted); flex-shrink: 0; }
.plus-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.search-bar:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-family: var(--font);
  padding: 14px 8px;
  outline: none;
  min-width: 0;
}

.search-input::placeholder { color: var(--text-muted); }

.mic-btn {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.mic-btn:hover { background: var(--surface-2); color: var(--brand-primary); }
.mic-btn.listening { background: var(--brand-secondary); color: white; animation: pulse 1.4s ease-in-out infinite; }

.voice-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 6px;
  padding: 0;
}

.voice-btn:hover { background: var(--surface-2); border-color: var(--brand-primary); color: var(--brand-primary); }
.voice-btn:active { transform: scale(0.96); }
.voice-btn.speaking { background: var(--brand-secondary); border-color: var(--brand-secondary); color: #fff; animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 91, 252, 0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(62, 91, 252, 0); }
}

/* ── Waveform conversation button ─────────────────────────────────── */
.wave-btn {
  background: var(--brand-primary);  /* AlfaTech Navy — matches the logo (bars stay AlfaTech Lime) */
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background var(--transition), transform 0.15s;
  flex-shrink: 0;
  margin-left: 6px;
  padding: 0;
}
.wave-btn:hover  { background: var(--brand-primary); }
.wave-btn:active { transform: scale(0.96); }

.wave-bar {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: var(--brand-accent);  /* AlfaTech Lime */
  transform-origin: center;
  transition: height 0.08s ease;
}

/* Idle silhouette — clean symmetric sound wave instead of flat dots */
.wave-btn .wave-bar:nth-child(1) { height: 7px;  }
.wave-btn .wave-bar:nth-child(2) { height: 13px; }
.wave-btn .wave-bar:nth-child(3) { height: 19px; }
.wave-btn .wave-bar:nth-child(4) { height: 13px; }
.wave-btn .wave-bar:nth-child(5) { height: 7px;  }

/* Forge is speaking — CSS animated bars */
.wave-btn.forge-speaking .wave-bar { animation: wave-forge 0.7s ease-in-out infinite alternate; }
.wave-btn.forge-speaking .wave-bar:nth-child(1) { animation-duration: 0.65s; animation-delay: 0.00s; }
.wave-btn.forge-speaking .wave-bar:nth-child(2) { animation-duration: 0.50s; animation-delay: 0.12s; }
.wave-btn.forge-speaking .wave-bar:nth-child(3) { animation-duration: 0.72s; animation-delay: 0.24s; }
.wave-btn.forge-speaking .wave-bar:nth-child(4) { animation-duration: 0.55s; animation-delay: 0.10s; }
.wave-btn.forge-speaking .wave-bar:nth-child(5) { animation-duration: 0.63s; animation-delay: 0.00s; }

@keyframes wave-forge {
  0%   { height: 3px;  }
  100% { height: 18px; }
}

/* User is speaking — green, real-time bar heights set by JS */
.wave-btn.user-listening { background: #15803d; }

/* Conversation active idle state */
.wave-btn.conversation-active { background: var(--brand-primary); }

/* Result bar sizing */
.search-shell.result-search .wave-btn { width: 38px; height: 38px; min-width: 38px; }

/* ── Settings (ChatGPT-style sectioned modal) ─────────────────────── */
.settings-shell {
  display: flex;
  width: min(760px, 94vw);
  height: min(560px, 88vh);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,.22);
}
.settings-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
}
.settings-title { font-size: 18px; font-weight: 800; margin: 0 0 14px 8px; color: var(--text); }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: none; border: none; border-radius: 8px;
  color: var(--text-muted); font: 600 13.5px/1.2 inherit; text-align: left;
  cursor: pointer; transition: background .12s, color .12s;
}
.settings-nav-item:hover { background: rgba(128,128,128,.10); color: var(--text); }
.settings-nav-item.active { background: var(--surface); color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--border); }
.settings-nav-item svg { flex-shrink: 0; }

.settings-content { flex: 1; position: relative; padding: 26px 28px; overflow-y: auto; }
.settings-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 18px; line-height: 1;
  color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px;
}
.settings-close:hover { background: var(--surface-2); color: var(--text); }
.settings-pane[hidden] { display: none; }
.settings-pane-title { font-size: 17px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.settings-pane-sub { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0 0 16px; }

.theme-options { display: flex; gap: 10px; }
.theme-opt {
  flex: 1; padding: 14px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: 600 13px/1 inherit; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.theme-opt:hover { background: var(--surface-2); }
.theme-opt.active { border-color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--brand-primary); color: var(--brand-primary); }

.settings-help-list { margin: 0 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; }
.settings-help-list li { font-size: 13px; color: var(--text); line-height: 1.5; }
.settings-help-list a { color: var(--brand-primary); text-decoration: none; }
.settings-help-list a:hover { text-decoration: underline; }
.settings-sub-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 0 0 10px; }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.settings-term-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.settings-term-list li { font-size: 13px; color: var(--text); line-height: 1.5; }
.settings-term-desc { color: var(--text-muted); }

.settings-about { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.settings-about > div { display: flex; gap: 12px; font-size: 13px; }
.settings-about dt { width: 110px; flex-shrink: 0; color: var(--text-muted); font-weight: 600; }
.settings-about dd { margin: 0; color: var(--text); }

.settings-primary-btn {
  padding: 10px 18px; background: var(--brand-primary); color: #fff;
  border: none; border-radius: 8px; font: 600 13px/1 inherit; cursor: pointer;
}
.settings-primary-btn:hover { opacity: .9; }

@media (max-width: 600px) {
  .settings-shell { flex-direction: column; height: min(640px, 90vh); }
  .settings-sidebar { width: auto; flex-direction: row; overflow-x: auto; padding: 12px; }
  .settings-sidebar .settings-title { display: none; }
  .settings-nav { flex-direction: row; }
  .settings-nav-item span { display: none; }
}

/* ── Voice picker ─────────────────────────────────────────────────── */
.footer-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--brand-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-link:hover { color: var(--brand-secondary); }

.voice-hint { margin: 0 0 14px; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.voice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 52vh;
  overflow-y: auto;
}
.voice-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.voice-row:hover { background: var(--surface-2); }
.voice-row.selected { border-color: var(--brand-primary); background: var(--surface-2); }
.voice-preview {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.voice-preview:hover  { background: var(--brand-secondary); }
.voice-preview:active { transform: scale(0.92); }
.voice-preview.loading { opacity: 0.55; animation: voice-pulse 0.9s ease-in-out infinite; }
@keyframes voice-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 0.85; } }
.voice-name { font-size: 14px; font-weight: 600; color: var(--text); min-width: 64px; }
.voice-desc {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}
.voice-row.selected .voice-name { color: var(--brand-primary); }
.voice-check {
  width: 16px;
  color: var(--brand-primary);
  font-weight: 700;
  opacity: 0;
}
.voice-row.selected .voice-check { opacity: 1; }

.submit-btn {
  background: var(--brand-primary);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  margin-left: 4px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.submit-btn:hover { background: var(--brand-secondary); }
.submit-btn:active { transform: scale(0.96); }

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.chip {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.dash-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 2px solid var(--brand-primary);
  background: transparent;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .01em;
}

.dash-link-btn:hover {
  background: var(--brand-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14,42,110,.18);
}

html[data-theme="dark"] .dash-link-btn {
  background: #0E2A6E;
  border-color: var(--brand-secondary);
  color: #fff;
}

html[data-theme="dark"] .dash-link-btn:hover {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .dash-link-btn {
    background: #0E2A6E;
    border-color: var(--brand-secondary);
    color: #fff;
  }
  html[data-theme="auto"] .dash-link-btn:hover {
    background: var(--brand-secondary);
    border-color: var(--brand-secondary);
  }
}

.kpi-strip {
  margin-top: 64px;
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.kpi-strip .kpi-mini b { color: var(--text); font-weight: 600; }

/* ---------- result page (Google-style dashboard) ---------- */
.result-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

/* Full-width sticky search header — sits outside the max-width container so the
   background and border-bottom span edge to edge like Google's results page.
   top is set by JS (_enterResultMode) so it sticks just below app-header. */
.result-search-header {
  position: sticky;
  top: 68px; /* fallback — JS overrides to exact app-header height */
  z-index: 99;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* Inner wrapper constrains content to the same 1200px as the rest of the page */
.result-search-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.result-forge-mark {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.result-forge-mark:hover { opacity: 0.75; }
.rfm-for { color: var(--brand-primary); }
.rfm-ge  { color: var(--brand-accent); }

.search-shell.result-search {
  flex: 1;
  max-width: 680px;
  margin: 0;
}

.search-shell.result-search .search-bar {
  padding: 4px 8px 4px 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.search-shell.result-search .search-input { font-size: 15px; padding: 10px 0; }
.search-shell.result-search .voice-btn { width: 38px; height: 38px; min-width: 38px; }

/* Google "All | Images | Videos" style tab row */
.result-tab-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 12px 0 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  z-index: 89;
  background: var(--bg);
}
.result-tab-row::-webkit-scrollbar { display: none; }

.result-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.result-tab:hover {
  color: var(--text);
}
.result-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* "New question" tab sits at the far right */
.result-tab-new {
  margin-left: auto;
}

/* "Pop out" sits just left of "New question" */
.result-tab-popout {
  margin-left: auto;
  color: var(--brand-primary);
  font-weight: 600;
}
.result-tab-popout + .result-tab-new { margin-left: 0; }

.result-tab-it {
  color: var(--brand-primary);
  font-weight: 600;
}

/* Audit log — policy violation row highlight */
.result-table tr.audit-violation td {
  background: color-mix(in srgb, #dc2626 8%, transparent);
  color: #b91c1c;
}
.result-table td[data-type="policy_violation"] {
  font-weight: 600;
  color: #b91c1c;
}

/* ── Progressive disclosure: summary card ──────────────────── */
.summary-card {
  position: relative;
  padding: 40px 36px 32px;
  text-align: center;
  max-width: 780px;
  margin: 24px auto 0;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--brand-primary) 20%, var(--border));
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 32px rgba(14, 42, 110, 0.10), 0 1px 4px rgba(14, 42, 110, 0.06);
}

/* Person variant — summary card widens and becomes a container */
.summary-card--person {
  max-width: 860px;
  padding: 20px 24px 0;
  text-align: left;
  overflow: hidden;
}
.summary-card--person .summary-label { display: none; }
.summary-card--person .summary-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 0 0;
  line-height: 1.4;
}

/* Nested snapshot panel — flush inside the summary card */
.ps-nested {
  margin: 12px -24px 0;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.ps-nested .ps-body {
  border-bottom: none;
}
.ps-nested .ps-drill {
  border-top: 1px solid var(--border);
  padding: 12px 24px 16px;
  background: var(--surface);
}
/* Keep inactive alert properly padded inside the flush panel */
.ps-nested-pad {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  padding-left: 24px;
  padding-right: 24px;
}

/* "Quick Summary" label floating on the top border line */
.summary-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  padding: 0 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--brand-primary);
  white-space: nowrap;
}

.summary-text {
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}

/* ── Aggregate result stat bar ──────────────────────────────────────── */
/* Replaces the "Quick Summary" text blob for non-person multi-row results. */
.result-stat-bar {
  max-width: 960px;
  margin: 24px auto 0;
}

.stat-tiles-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.stat-tile {
  flex: 1 1 160px;
  max-width: 220px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(14, 42, 110, 0.07);
}

.stat-tile--warn {
  border-color: color-mix(in srgb, #e65100 40%, var(--border));
}

.stat-tile--clickable {
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.stat-tile--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14, 42, 110, 0.14);
  border-color: var(--brand-primary);
}
.stat-tile--clickable:active { transform: translateY(0); }

.stat-tile--filter-active {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface));
}

.stat-tile-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
  line-height: 1.1;
}

.stat-tile--warn .stat-tile-value {
  color: #e65100;
}

.stat-tile-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-tile-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Action pill row inside stat bar (Chart view, etc.) */
.stat-bar-pills {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

/* KPI tile icon */
.stat-tile-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--brand-primary);
  opacity: 0.65;
}
.stat-tile--warn .stat-tile-icon-wrap { color: var(--warn); opacity: 0.8; }

/* Result section headers — ServiceNow-style labelled dividers */
.result-section-hdr {
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: 960px;
  margin: 28px auto 10px;
  padding-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.section-hdr-count {
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.65;
}

/* AI Insight panel — replaces collapsible summary toggle */
.ai-insight-panel {
  max-width: 960px;
  margin: 20px auto 12px;
  background: color-mix(in srgb, var(--brand-primary) 4%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 14%, var(--border));
  border-radius: var(--radius);
  padding: 16px 20px;
}
.ai-insight-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  margin-bottom: 8px;
}
.ai-insight-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Optimization opportunity alert panel (ServiceNow-style) */
.optim-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  background: color-mix(in srgb, var(--warn) 8%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 12px 0 4px;
}
.optim-icon {
  color: var(--warn);
  flex-shrink: 0;
}
.optim-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.optim-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.optim-desc {
  font-size: 13px;
  color: var(--text-muted);
}
.optim-btn {
  flex-shrink: 0;
  background: var(--warn);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--transition);
  white-space: nowrap;
}
.optim-btn:hover { filter: brightness(0.88); }

/* Table pulse — triggered when a stat tile is clicked */
@keyframes table-pulse {
  0%   { outline-color: transparent; }
  35%  { outline-color: var(--brand-primary); }
  100% { outline-color: transparent; }
}
.table-highlight {
  outline: 3px solid transparent;
  outline-offset: 2px;
  animation: table-pulse 0.9s ease-out forwards;
}

/* Section header flash — triggered when a KPI tile is clicked */
@keyframes section-flash-anim {
  0%   { background: color-mix(in srgb, var(--brand-primary) 14%, transparent); color: var(--brand-primary); }
  100% { background: transparent; color: var(--text-muted); }
}
.section-flash {
  animation: section-flash-anim 1.4s ease-out forwards;
  border-radius: 6px;
  padding-left: 8px;
  margin-left: -8px;
}

/* Chart truncation note */
.chart-truncation-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0 4px;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

/* Filter notice bar at the top of a filtered table */
.table-filter-notice {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--surface));
  border-bottom: 1px solid var(--border);
}
.table-filter-clear {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.table-filter-clear:hover { text-decoration: underline; }

/* Collapsible paragraph summary */
.summary-toggle {
  max-width: 780px;
  margin: 12px auto 0;
}

.summary-toggle-btn {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}
.summary-toggle-btn::-webkit-details-marker { display: none; }
.summary-toggle-btn::after {
  content: "▾";
  font-size: 11px;
  transition: transform 0.2s;
}
details[open] .summary-toggle-btn::after { transform: rotate(-180deg); }

.summary-toggle-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin: 10px 0 0;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
}

/* Compliance traffic-light badges in table */
.compliance-ok,
.compliance-warn,
.compliance-over {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 6px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.compliance-ok   { background: color-mix(in srgb, #2e7d32 12%, transparent); color: #2e7d32; }
.compliance-warn { background: color-mix(in srgb, #f57c00 12%, transparent); color: #e65100; }
.compliance-over { background: color-mix(in srgb, #c62828 12%, transparent); color: #c62828; }

/* The colored circle dot */
.traffic-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.compliance-ok   .traffic-dot { background: #43a047; }
.compliance-warn .traffic-dot { background: #fb8c00; }
.compliance-over .traffic-dot { background: #e53935; }

/* Thinking / loading pill — rotates messages while waiting for the API */
.thinking-pill {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 52px auto 0;
  padding: 16px 52px;
  min-width: 280px;
  max-width: 480px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  animation: pill-pulse 1.8s ease-in-out infinite;
  box-shadow: var(--shadow);
}

@keyframes pill-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* Chart-level nav pill row — same layout as summary-actions */
.chart-nav {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 0 12px;
}

/* Two-pill choice buttons — sit outside and below the summary card */
.summary-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-bottom: 8px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid var(--brand-primary);
  background: transparent;
  color: var(--brand-primary);
  letter-spacing: 0.01em;
}
.summary-pill svg { flex-shrink: 0; }
.summary-pill:hover { background: var(--brand-primary); color: #fff; }
.summary-pill:active { opacity: 0.8; transform: translateY(1px); }

.summary-pill--primary {
  background: var(--brand-primary);
  color: #fff;
}
.summary-pill--primary:hover { opacity: 0.88; background: var(--brand-primary); }

.breakdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.breakdown-btn:hover  { opacity: 0.88; transform: translateY(1px); }
.breakdown-btn:active { opacity: 0.78; transform: translateY(2px); }
.breakdown-btn svg    { flex-shrink: 0; }

.breakdown-btn--secondary {
  background: transparent;
  color: var(--brand-primary);
  border: 2px solid var(--brand-primary);
  font-size: 14px;
  padding: 10px 22px;
}
.breakdown-btn--secondary:hover { background: var(--brand-primary); color: #fff; opacity: 1; }

.detail-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 4px;
}
.detail-divider::before,
.detail-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.detail-divider[hidden] { display: none; }

/* ── Dashboard grid ─────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 8px;
}

@media (min-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-grid > .hero-answer { grid-column: 1 / -1; }
  .dashboard-grid > .chart-container { grid-column: 1 / -1; }
  .dashboard-grid > .table-container { grid-column: 1 / -1; }
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.dashboard-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* result-header / result-question removed — query now lives in the header search bar */

.action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.hero-answer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.hero-answer-big {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand-primary);
  margin-bottom: 8px;
}

.hero-answer-label {
  color: var(--text-muted);
  font-size: 14px;
}

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  min-height: 320px;
  height: auto;
  position: relative;
}

.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 65vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- loading / errors ---------- */
.loading {
  opacity: 0.5;
}

/* Animated loading border on the search shell when a query is in flight */
.search-shell.querying {
  animation: query-border-pulse 1.2s ease-in-out infinite;
}
@keyframes query-border-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--brand-primary); }
  50%       { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 40%, transparent); }
}

/* Loading bar that slides across the top of the result section */
#forge-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--brand-primary);
  z-index: 9999;
  animation: loading-bar-slide 25s linear forwards;
}
@keyframes loading-bar-slide {
  0%   { width: 0%; }
  80%  { width: 85%; }
  100% { width: 92%; }
}

.error-card {
  background: rgba(217, 45, 32, 0.06);
  border: 1px solid rgba(217, 45, 32, 0.3);
  color: var(--danger);
  padding: 18px 22px;
  border-radius: var(--radius);
  font-size: 14px;
}

/* ---------- footer ---------- */
.app-footer {
  position: fixed;
  bottom: 0;
  left: var(--fr-rail-w, 0);
  right: 0;
  z-index: 90;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 9px 24px;
  padding-bottom: max(9px, env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-size: 12px;
}
/* Keep page content clear of the now-fixed footer. */
body:has(.app-footer) { padding-bottom: 48px; }

.app-footer strong       { color: #0E2A6E; }
.app-footer .footer-alfa { color: #0E2A6E; font-weight: 700; }
.app-footer .footer-tech { color: #C5D632; font-weight: 800; }
html[data-theme="dark"] .app-footer strong,
html[data-theme="dark"] .app-footer .footer-alfa { color: #4f7cd9; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .app-footer strong,
  html[data-theme="auto"] .app-footer .footer-alfa { color: #4f7cd9; }
}

/* ---------- mobile / iPad ---------- */
@media (max-width: 640px) {
  .app-header { padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top)); }
  .landing-logo { font-size: 42px; margin-bottom: 28px; }
  .landing-icon { width: 68px; height: 68px; border-radius: 22%; margin-bottom: 18px; }
  .landing-greeting { display: none; }
  .search-input { font-size: 16px; padding: 12px 6px; }
  .hero-answer { padding: 24px; }
  .hero-answer-big { font-size: 36px; }
  .chart-container { min-height: 280px; height: auto; padding: 16px; }
  .kpi-strip { gap: 16px; margin-top: 40px; }
  .user-chip { display: none; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  /* iPad — preserve generous spacing */
  .landing-logo { font-size: 64px; }
  .search-shell { max-width: 560px; }
}

/* ---------- Add Capital Project button + modal ---------- */
.add-project-btn {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
}
.add-project-btn:hover { background: #14367d; transform: translateY(-1px); }
.add-project-btn:active { transform: translateY(0); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 17, 22, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }

.modal-shell {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}
.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select,
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  transition: border-color var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-primary);
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.action-btn.primary {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}
.action-btn.primary:hover { background: #14367d; }

.modal-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.modal-status.success {
  background: rgba(26, 164, 99, 0.12);
  color: var(--success);
}
.modal-status.error {
  background: rgba(217, 45, 32, 0.10);
  color: var(--danger);
}
.modal-status.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

@media (max-width: 640px) {
  .add-project-btn { font-size: 12px; padding: 7px 12px; }
}

/* ---------- Empty / error state — no card, no icon, suggestion-first ---------- */
.empty-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 32px 0 24px;
}

/* Hide the card chrome when showing an empty/error state */
.table-container:has(.empty-result) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.empty-result-disclaimer {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 520px;
  margin: 12px 0 0;
}
.empty-result-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 520px;
  margin: 10px 0 0;
}
.empty-result-action-btn.email-sent {
  border-color: #1a7f4b;
  color: #1a7f4b;
  background: color-mix(in srgb, #1a7f4b 8%, transparent);
  cursor: default;
}
.suggestion-prompt {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: 24px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  max-width: 480px;
  text-align: left;
}
.suggestion-prompt:hover {
  background: var(--accent);
  color: #fff;
}
.suggestion-prompt-label {
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.75;
}
.suggestion-prompt-text {
  flex: 1;
  line-height: 1.4;
}
.suggestion-prompt-arrow {
  font-size: 16px;
  white-space: nowrap;
}
.empty-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.empty-result-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.empty-result-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* ---------- Email recipient candidates ---------- */
.email-candidates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: var(--surface-2);
}
.candidate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition);
}
.candidate:hover { border-color: var(--brand-primary); }
.cand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.cand-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Upload drop zone + preview ---------- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--brand-primary);
  background: rgba(14, 42, 110, 0.05);
}
.drop-icon {
  margin-bottom: 14px;
  color: var(--brand-primary);
  display: flex;
  justify-content: center;
}
.drop-text { font-size: 15px; color: var(--text); }
.drop-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

#upload-preview { margin-top: 18px; }
.preview-header {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
  margin-bottom: 6px;
}
.preview-pill {
  background: var(--brand-primary); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.preview-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.preview-addr { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.preview-assign-wrap {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface-2, #f5f7fa); border-radius: 6px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px;
}
.assign-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.assign-label { font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.assign-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Employee type-ahead lookup (ServiceNow reference field pattern) */
.emp-lookup-wrap { position: relative; }
.emp-search-box { position: relative; }
.emp-search-input {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface, #fff); color: var(--text);
  outline: none;
}
.emp-search-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 15%, transparent); }
.emp-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-height: 220px; overflow-y: auto;
}
.emp-result-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.emp-result-row:last-child { border-bottom: none; }
.emp-result-row:hover { background: color-mix(in srgb, var(--brand-primary) 8%, transparent); }
.emp-result-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.emp-result-info { flex: 1; min-width: 0; }
.emp-result-name { font-weight: 600; font-size: 13px; color: var(--text); }
.emp-result-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-selected {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 30%, transparent);
  border-radius: 6px; font-size: 13px;
}
.emp-selected-info { flex: 1; }
.emp-selected-name { font-weight: 600; color: var(--text); }
.emp-selected-email { font-size: 11px; color: var(--text-muted); }
.emp-clear-btn {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 16px; padding: 0 4px; line-height: 1;
}
.emp-clear-btn:hover { color: var(--text); }
.preview-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview-table th, .preview-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.preview-table th { color: var(--brand-primary); font-weight: 600; }
.preview-table td .meta-row { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.inv-skip-row { opacity: 0.45; }
.inv-skip-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; background: var(--text-muted); color: #fff;
  padding: 1px 5px; border-radius: 3px; margin-right: 5px; vertical-align: middle;
}
.inv-serials { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.inv-serials code {
  font-size: 11px; background: var(--surface-2, #f0f4ff);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; color: var(--brand-primary); font-family: monospace;
}

/* ---------- Full dashboard page (dashboard.html) ---------- */
.dash-page {
  padding-bottom: 48px;
}

/* Loading / error status bar */
.dash-status {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.dash-status.dash-status-error {
  border-color: var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

/* KPI tile row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.dash-kpi-tile {
  padding: 18px 20px;
}

.dash-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dash-kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
  line-height: 1.1;
}

.dash-kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Charts row — two side-by-side cards */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (min-width: 860px) {
  .dash-charts-row {
    grid-template-columns: 1fr 1fr;
  }
}

.dash-chart-card {
  padding: 20px 22px;
}

.dash-chart-wrap {
  position: relative;
  height: 280px;
}

/* Chart canvas — pointer cursor to hint interactivity */
#result-chart {
  cursor: pointer;
}

/* Sortable table headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-th:hover { color: var(--brand-primary); }
.sortable-th.sort-active { color: var(--brand-primary); }

/* ---------- Clarification prompt (ambiguous entity) ---------- */
.clarification-message {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.5;
  max-width: 520px;
}

.clarification-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.clarification-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  max-width: 520px;
}

.clarification-option:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
}

.clarification-arrow {
  font-size: 15px;
  opacity: 0.5;
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- "Show more ↓" button (result page → dashboard) ---------- */
.show-more-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.show-more-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 5%, var(--surface));
}

/* ---------- Name-resolution hint banner ---------- */
.name-hint-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  margin: 0 0 10px;
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 30%, var(--border));
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.name-hint-banner strong {
  color: var(--brand-primary);
}

.name-hint-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.name-hint-yes {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.name-hint-yes:hover { opacity: 0.88; }

.name-hint-dismiss {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.name-hint-dismiss:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

/* ---------- Secondment disclosure notice banner ---------- */
.secondment-notice-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  margin: 0 0 10px;
  background: color-mix(in srgb, #b45309 6%, var(--surface));
  border: 1px solid color-mix(in srgb, #b45309 28%, var(--border));
  border-left: 3px solid #b45309;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.secondment-notice-banner span {
  flex: 1;
}

.secondment-dismiss {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid color-mix(in srgb, #b45309 35%, var(--border));
  cursor: pointer;
  color: #92400e;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.secondment-dismiss:hover {
  background: color-mix(in srgb, #b45309 10%, transparent);
  color: #78350f;
}

/* ---------- Per-employee drilldown offer ---------- */
.drilldown-offer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px auto 0;
  padding: 14px 20px;
  max-width: 760px;
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 25%, var(--border));
  border-radius: 12px;
}

.drilldown-offer-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
  min-width: 160px;
}

/* ---------- Follow-up question chips ---------- */
.followup-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px auto 0;
  padding: 14px 18px;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.followup-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.followup-label strong {
  color: var(--brand-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.followup-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0;
}

.followup-input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.followup-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 14%, transparent);
}

.followup-input::placeholder {
  color: var(--text-muted);
}

.followup-send {
  border: 1px solid var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
  width: 40px;
  border-radius: 999px;
  font-size: 16px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.followup-send:hover {
  background: color-mix(in srgb, var(--brand-primary) 88%, black);
}

.followup-send:active {
  opacity: 0.85;
}

.followup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.followup-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.followup-chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
}

/* Dept suggestion bar — full-sentence chips, centered under summary card */
.dept-suggestions-bar {
  max-width: 780px;
  margin: 12px auto 0;
  justify-content: center;
}
.dept-suggestions-bar .followup-chips {
  justify-content: center;
}
.dept-suggestion-chip {
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 14px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

/* ---------- Person disambiguation (multiple candidates) ---------- */
.disambig-block {
  max-width: 760px;
  margin: 20px auto 0;
}

.candidate-group {
  margin-bottom: 18px;
}

.candidate-prompt {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 10px 4px;
}

.candidate-prompt strong {
  color: var(--text);
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.candidate-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}

.candidate-card:hover {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--surface));
}

.candidate-card:active {
  transform: translateY(1px);
}

.cand-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.cand-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.cand-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cand-inactive {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  margin-left: 6px;
}

.cand-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.cand-badge--primary {
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  color: var(--brand-primary);
}
.cand-badge--seconded {
  background: color-mix(in srgb, var(--brand-secondary) 12%, transparent);
  color: var(--brand-secondary);
}

/* ---------- product-explain bundle expansion ---------- */
.product-explain-header {
  padding: 12px 16px 10px;
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--surface));
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}

.pe-vendor {
  font-weight: 700;
  color: var(--text);
}

.pe-product {
  color: var(--text);
}

.pe-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ── Disambiguation table (ServiceNow-style record picker) ───────────────── */
.disambig-table-wrap {
  max-width: 780px;
  margin: 16px auto 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.disambig-table-label {
  padding: 10px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.disambig-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.disambig-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.disambig-table td {
  padding: 10px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.disambig-table tr:last-child td { border-bottom: none; }
.disambig-table tbody tr {
  cursor: pointer;
  transition: background .12s;
}
.disambig-table tbody tr:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.disambig-table tbody tr.loading-row { opacity: .5; pointer-events: none; }
.disambig-name-cell { font-weight: 500; color: var(--accent); }
.disambig-active  { color: #22c55e; font-size: 12px; font-weight: 600; }
.disambig-inactive { color: var(--text-muted); font-size: 12px; }
/* Active person: 3px green left border on the row */
.disambig-table tbody tr.disambig-row-active {
  border-left: 3px solid #22c55e;
}

/* ── Disambiguation person-card grid ─────────────────────────────────────── */
.disambig-card-wrap {
  max-width: 780px;
  margin: 16px auto 0;
}
.disambig-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}
.disambig-person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  width: 100%;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.disambig-person-card:hover {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--surface));
}
.disambig-person-card:active { transform: translateY(1px); }
.disambig-person-card.loading-card { opacity: .5; pointer-events: none; }
.dpc-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dpc-avatar--inactive { background: var(--text-muted); }
.dpc-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.dpc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dpc-title, .dpc-location {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dpc-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Person Record Card (ServiceNow-style) ───────────────────────────────── */
.person-record-card,
.person-snapshot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin: 8px auto 24px;
  max-width: 860px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
}

/* Snapshot body: avatar + identity in a row, same padding as pr-header */
.ps-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Drill-down footer */
.ps-drill {
  padding: 14px 24px;
  display: flex;
  justify-content: flex-end;
  background: var(--surface);
}
.ps-drill-btn {
  padding: 8px 20px;
  background: var(--accent, #1a73e8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.ps-drill-btn:hover { opacity: .88; }

/* Nav strip — back button */
.pr-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.pr-nav-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pr-nav-back:hover { text-decoration: underline; }

/* Record header: avatar + identity + action buttons */
.pr-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pr-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.pr-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.pr-avatar--asset    { background: #0f766e; } /* teal — hardware */
.pr-avatar--software { background: #7c3aed; } /* purple — software */
.pr-avatar--ci       { background: #b45309; } /* amber — CI */
.pr-avatar--circuit  { background: #0369a1; } /* blue — circuit / telecom */
.pr-avatar--service  { background: #be185d; } /* rose — service contract / copier-plotter lease */
.pr-identity { flex: 1; min-width: 0; }
.pr-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}
.pr-title {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.pr-header-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}
.pr-action-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.pr-action-btn:hover { background: var(--surface-2); }
.pr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.pr-badge-active   { background: rgba(34,197,94,.12); color: #16a34a; }
.pr-badge-inactive { background: rgba(0,0,0,.06); color: var(--text-muted); }
.pr-badge-stock    { background: rgba(59,130,246,.12); color: #2563eb; }  /* In Stock — blue */
.pr-badge-warn     { background: rgba(217,119,6,.14);  color: #b45309; }  /* renewal due soon — amber */
.pr-badge-danger   { background: rgba(217,45,32,.12);  color: #b42318; }  /* renewal overdue — red */

/* 2-column form grid */
.pr-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.pr-field {
  padding: 8px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pr-field:nth-child(even) { border-right: none; }
.pr-field--wide {
  grid-column: span 2;
  border-right: none;
}
.pr-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.pr-field-value {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}
.pr-field-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.pr-field-link:hover { text-decoration: underline; }

/* Collapsible related lists */
.pr-related-list {
  border-bottom: 1px solid var(--border);
}
.pr-related-list:last-child { border-bottom: none; }
.pr-related-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  cursor: pointer;
  user-select: none;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.pr-related-header:hover { background: var(--hover-bg, rgba(0,0,0,.06)); }
.pr-related-list--collapsed .pr-related-header { border-bottom: none; }
.pr-related-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
  flex: 1;
}
.pr-related-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
}
.pr-related-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform .2s;
  line-height: 1;
}
.pr-related-list--collapsed .pr-related-chevron { transform: rotate(-90deg); }
.pr-related-body { overflow: hidden; }
.pr-related-list--collapsed .pr-related-body { display: none; }

/* Tables inside related lists */
.pr-section-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pr-section-table th {
  padding: 8px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pr-section-table td {
  padding: 9px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.pr-section-table tr:last-child td { border-bottom: none; }
.pr-section-table tbody tr.clickable-row {
  cursor: pointer;
  transition: background .1s;
}
.pr-section-table tbody tr.clickable-row:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.pr-empty {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Hardware: ServiceNow grouped related list ──────────────────────────── */
/* Legacy accordion headers — kept for graceful fallback */
.hw-group-header { background: var(--surface-2, #f4f5f7); cursor: pointer; user-select: none; }
.hw-group-header:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.hw-group-header td { padding: 7px 20px; border-bottom: 1px solid var(--border); }
.hw-group-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.hw-group-name  { flex: 1; }
.hw-group-count { background: var(--border); border-radius: 10px; padding: 1px 7px; font-size: 10px; font-weight: 600; }
.hw-group-chevron { font-size: 10px; transition: transform .15s; color: var(--text-muted); }
.hw-loc-icon    { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.hw-loc-office  { background: #3b82f6; }   /* Computers — blue    */
.hw-loc-mobile  { background: #06b6d4; }   /* Mobile Devices — teal */
.hw-loc-home    { background: #22c55e; }   /* Home Office — green */
.hw-loc-virtual { background: #a855f7; }   /* Virtual — purple    */
.hw-grp-isolated { background: rgba(26,115,232,.06); } /* active group highlight */

/* ── Hardware filter chips (new) ───────────────────────────────────────── */
.hw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 8px;
  border-bottom: 1px solid var(--border);
}
.hw-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.hw-chip:hover { border-color: var(--accent, #1a73e8); color: var(--accent, #1a73e8); }
.hw-chip--active {
  background: rgba(26,115,232,.08);
  border-color: var(--accent, #1a73e8);
  color: var(--accent, #1a73e8);
}
.hw-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent, #1a73e8);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.hw-chip:not(.hw-chip--active) .hw-chip-count {
  background: var(--border);
  color: var(--text-muted);
}
@media (prefers-color-scheme: dark) {
  .hw-chip { background: var(--surface, #1e1e1e); }
  .hw-chip--active { background: rgba(138,180,248,.12); border-color: #8ab4f8; color: #8ab4f8; }
  .hw-chip-count { background: #8ab4f8; color: #1e1e1e; }
}

.hw-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2, #f4f5f7);
  color: var(--text-muted);
  text-transform: capitalize;
}
.hw-badge-unknown { opacity: .4; }

/* ── Person record: secondment bar ─────────────────────────────────────── */
.pr-secondments {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-color, #e0e0e0);
}
.pr-secondment-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 4px;
}
.pr-secondment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 20px;
  background: var(--surface, #fff);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #1a73e8);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pr-secondment-pill:hover {
  border-color: var(--accent, #1a73e8);
  background: var(--accent-faint, rgba(26,115,232,.06));
}
.pr-secondment-type {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--hover-bg, rgba(0,0,0,.06));
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Person record: compact meta line ───────────────────────────────────── */
.pr-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.pr-meta a {
  color: var(--accent, #1a73e8);
  text-decoration: none;
}
.pr-meta a:hover { text-decoration: underline; }

/* ── Person record: tiles row (tab switchers) ───────────────────────────── */
/* Desktop: equal columns, always one row, compress to fit however many tiles exist */
.pr-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* Mobile: horizontal scroll strip — swipe to see all 7 (ServiceNow Now Mobile pattern) */
@media (max-width: 640px) {
  .pr-tiles {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
    grid-template-columns: unset;
  }
  .pr-tiles::-webkit-scrollbar { display: none; }
  .pr-tile {
    flex: 0 0 auto;
    width: 22vw;
    min-width: 72px;
    scroll-snap-align: start;
    border-right: 1px solid var(--border) !important;
  }
  .pr-tile:last-child { border-right: none !important; }
}
.pr-tile {
  padding: 11px 10px 9px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  text-align: center;
  user-select: none;
  min-width: 0;          /* allow grid cells to compress */
}
.pr-tile:last-child { border-right: none; }
.pr-tile:hover { background: rgba(0,0,0,.03); }
.pr-tile--active {
  background: rgba(26,115,232,.05);
  border-bottom: 2px solid var(--accent, #1a73e8);
}
.pr-tile-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent, #1a73e8);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr-tile-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (prefers-color-scheme: dark) {
  .pr-tile--active { background: rgba(138,180,248,.08); border-bottom-color: #8ab4f8; }
  .pr-tile-value { color: #8ab4f8; }
}

/* ── Person record: section panels (tab content) ────────────────────────── */
.pr-section         { display: none; }
.pr-section.visible { display: block; }

/* ── Person record: in-card follow-up bar ───────────────────────────────── */
.pr-followup {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.pr-followup-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.pr-followup-label strong {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text);
}
.pr-followup-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pr-followup-input {
  flex: 1;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--surface);
  outline: none;
  font-family: inherit;
}
.pr-followup-input:focus { border-color: var(--accent, #1a73e8); color: var(--text); }
.pr-followup-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #1a3a6e;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: #fff;
  transition: background .12s;
  line-height: 1;
}
.pr-followup-btn:hover { background: var(--accent, #1a73e8); }

/* ── Person record: direct-report pills ─────────────────────────────────── */
.pr-report-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.pr-report-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  cursor: pointer;
  background: var(--surface, #fff);
  transition: border-color .15s, box-shadow .15s;
}
.pr-report-pill:hover {
  border-color: var(--accent, #1a73e8);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.pr-report-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #1a73e8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pr-report-info { min-width: 0; }
.pr-report-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr-report-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr-report-loc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Inactive employee alert banner */
.pr-inactive-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px 0;
  padding: 12px 16px;
  background: #fff8e1;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
}
.pr-inactive-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.pr-inactive-text {
  font-size: 13px;
  line-height: 1.5;
}
.pr-inactive-text strong { color: #78350f; }
.pr-cleanup-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: #dc2626;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ================================================================
   Print / PDF stylesheet
   Hides all chrome; keeps the result content clean for printing.
   ================================================================ */
@media print {
  @page { margin: 1.5cm; }

  /* Hide everything that isn't content */
  .app-header,
  .result-search-header,
  .result-tab-row,
  .summary-actions,
  .followup-bar,
  .disambig-block,
  .disambig-table-wrap,
  .disambig-card-wrap,
  .pr-nav,
  .pr-header-actions,
  .pr-secondments,
  .ps-drill,
  .pr-related-chevron,
  #hero-answer,
  #chart-container { display: none !important; }

  /* Remove visual chrome */
  .person-record-card,
  .person-snapshot-card {
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
  }

  /* Show all tab sections when printing */
  .pr-section                { display: block !important; }
  .pr-tiles, .pr-followup   { display: none !important; }
  /* Legacy accordion compat (no-op but harmless) */
  .pr-related-list--collapsed .pr-related-body  { display: block !important; }

  /* Table: remove scroll wrapper so full table prints */
  #table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }
  .table-container {
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  body, #result-section { overflow: visible !important; }
}

/* "Or did you mean someone else?" row in disambig table */
.disambig-other-row {
  padding: 10px 0 4px 0;
  text-align: center;
}
.disambig-other-btn {
  background: none;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px;
  color: var(--text-secondary, #5f6368);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.disambig-other-btn:hover {
  border-color: var(--accent, #1a73e8);
  color: var(--accent, #1a73e8);
}

/* Focus-mode "More details" pill — shown at bottom of card when a section is focused */
.pr-more-details-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 0;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, color .15s;
}
.pr-more-details-btn:hover {
  border-color: var(--accent, #1a73e8);
  color: var(--accent, #1a73e8);
}

/* Location picker — circuit bill office assignment */
.location-select {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.location-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(14, 42, 110, 0.1);
}

/* ─── Location Record Card ─────────────────────────────────────────────────── */

/* The card reuses .person-record-card layout. Only location-specific overrides below. */
.location-record-card .lr-avatar {
  background: #dbeafe;
  color: #3b82f6;
}
.location-record-card .lr-avatar--inactive {
  background: #f3f4f6;
  color: #9ca3af;
}

.location-record-card .pr-sub-addr {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Person pills inside the people table */
.lr-person-pill {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #1a73e8);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color .15s;
}
.lr-person-pill:hover {
  text-decoration-color: var(--accent, #1a73e8);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CIRCUIT RECORD CARD  (telecom / ISP — outage-first layout)
   ───────────────────────────────────────────────────────────────────────────── */

/* Group header above stacked circuit cards */
.circuit-group-header {
  max-width: 860px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.circuit-group-header .pr-nav-back {
  background: none;
  border: none;
  color: var(--accent, #3E5BFC);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.circuit-group-header .pr-nav-back:hover { text-decoration: underline; }
.cg-titlebar { display: flex; align-items: center; gap: 8px; }
.cg-title { font-size: 16px; font-weight: 700; color: var(--text); }
.cg-count {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
}
/* Stacked cards get vertical separation */
.circuit-record-card + .circuit-record-card { margin-top: 16px; }
.service-record-card + .service-record-card { margin-top: 16px; }

/* Carrier support block — leads the card so outage info is first */
.circuit-support {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
}
.circuit-support-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.circuit-support-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.circuit-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: filter .12s, background .12s;
}
.circuit-phone  { background: var(--accent, #3E5BFC); color: #fff; border-color: transparent; }
.circuit-phone:hover { filter: brightness(1.08); }
.circuit-portal { background: var(--surface); color: var(--text); }
.circuit-portal:hover { background: var(--surface-2); }
.circuit-email  { background: var(--surface); color: var(--text); }
.circuit-email:hover { background: var(--surface-2); }

.circuit-id-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.circuit-id-chip {
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}
.circuit-id-chip .ci-k {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

/* Cost tiles */
.circuit-cost-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.circuit-cost-tile {
  background: var(--surface);
  padding: 14px 12px;
  text-align: center;
}
.cc-value { font-size: 18px; font-weight: 700; color: var(--text); }
.cc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Notes */
.circuit-notes { padding: 14px 18px; background: var(--surface); }
.circuit-notes-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.circuit-notes-body { font-size: 13px; color: var(--text); line-height: 1.5; }

/* Clickable circuit rows in the location card (uses .pr-table, not .pr-section-table) */
.pr-table tbody tr.clickable-row { cursor: pointer; }
.pr-table tbody tr.clickable-row:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }

@media (max-width: 560px) {
  .circuit-cost-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   REDESIGN 2026-06 · Phase A — left rail shell + modern home
   Additive; overrides earlier rules by source order. Uses the
   existing design tokens, so light / dark / auto all work.
   ============================================================ */
:root {
  --fr-rail-w: 86px;
  --fr-rail-w-collapsed: 54px;
}

/* Shift app content only when the rail is present (index.html). Pop-out
   result pages (dashboard.html, rehearse.html) share this stylesheet but
   do not render the rail, so they must NOT inherit the left padding. */
body:has(.fr-rail) { padding-left: var(--fr-rail-w); transition: padding-left 0.18s ease; }
body:has(.fr-rail.fr-rail--collapsed) { padding-left: var(--fr-rail-w-collapsed); }
.fr-rail { transition: width 0.18s ease; }
.fr-rail.fr-rail--collapsed { width: var(--fr-rail-w-collapsed); }
.fr-rail.fr-rail--collapsed .fr-item span,
.fr-rail.fr-rail--collapsed .fr-logo { display: none; }
.fr-rail.fr-rail--collapsed .fr-item { width: 46px; height: 46px; }
.fr-rail.fr-rail--collapsed { padding-top: 12px; }
/* Toggle stays visible when collapsed so the user can always expand back. */
.fr-rail.fr-rail--collapsed .fr-rail-toggle { margin-bottom: 12px; }

/* Toggle button — at the top of the rail, below where macOS window controls sit */
.fr-rail-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); border-radius: 6px; margin: 0 auto 8px;
  transition: background 0.15s, color 0.15s;
}
.fr-rail-toggle:hover { background: var(--surface-2); color: var(--brand-primary); }
.fr-rail-toggle:active { transform: scale(0.94); }

/* ---------- Left rail (quick-launchers) ---------- */
.fr-rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--fr-rail-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 14px; z-index: 250;
}
.fr-logo { width: 42px; height: 42px; border-radius: 12px; overflow: hidden;
  margin-bottom: 14px; flex-shrink: 0; box-shadow: 0 1px 6px rgba(0,0,0,.28); }
.fr-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.fr-nav { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.fr-item { width: 70px; height: 56px; border: none; background: transparent; cursor: pointer;
  border-radius: 12px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px; color: var(--text-muted); font-family: var(--font);
  position: relative; transition: background .15s, color .15s; }
.fr-item span { font-size: 10.5px; font-weight: 600; letter-spacing: .1px; }
.fr-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fr-item:hover { background: color-mix(in srgb, var(--brand-primary) 7%, transparent); color: var(--brand-primary); }
.fr-item.active { background: color-mix(in srgb, var(--brand-primary) 10%, transparent); color: var(--brand-primary); }
.fr-item.active::before { content: ""; position: absolute; left: -3px; top: 14px; bottom: 14px;
  width: 3px; border-radius: 3px; background: var(--brand-accent); }
.fr-rail .fr-spacer { flex: 1; }

/* ---------- Top bar (restyle existing #app-header) ----------
   Three-zone grid: brand (left) · search pill (center) · actions (right).
   The kbar lives in the centered middle column so it reads as the primary
   search affordance, not an afterthought tucked next to the wordmark. */
.app-header { background: var(--surface); border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 18px; padding: 10px 24px; }
/* Pin each zone to its column so hiding the brand in result mode (app.js
   _enterResultMode) does NOT let the search + actions auto-shift left. */
.app-header > .brand { justify-self: start; grid-column: 1; }
.app-header > .fr-kbar { justify-self: center; margin: 0; grid-column: 2; }
.app-header > .header-actions { justify-self: end; grid-column: 3; }
/* The result-mode "Forge" wordmark is redundant now that the left rail has
   a Home button — hide it. */
.result-forge-mark { display: none !important; }
.fr-kbar { display: flex; align-items: center; gap: 9px; width: 320px; max-width: 32vw;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 11px; cursor: pointer; color: var(--text-muted); font-family: var(--font); }
.fr-kbar svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.fr-kbar .fr-kbar-ph { flex: 1; font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-kbar .fr-kbd { display: flex; gap: 3px; flex-shrink: 0; }
.fr-kbar .fr-kbd span { background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

/* Header search is a real input now — the pill becomes a text field with a live,
   grouped results dropdown (People / Records / Sites). See shell.js initKbarSearch. */
.fr-kbar { position: relative; cursor: text; }
.fr-kbar:focus-within { border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 16%, transparent); }
.fr-kbar .fr-kbar-input { flex: 1; min-width: 0; border: none; outline: none; background: none;
  margin: 0; padding: 0; font-family: var(--font); font-size: 13px; color: var(--text); }
.fr-kbar .fr-kbar-input::placeholder { color: var(--text-muted); }
.fr-kbar .fr-kbar-input::-webkit-search-cancel-button,
.fr-kbar .fr-kbar-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.fr-kbar-results { position: absolute; top: calc(100% + 8px); left: 0; width: min(440px, 92vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 1000; max-height: 72vh; overflow-y: auto;
  text-align: left; cursor: default; }
.fr-kbar-results[hidden] { display: none; }
.fr-kbar-group-label { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-muted); padding: 9px 12px 4px; }
.fr-kbar-row, .fr-kbar-ask { display: flex; align-items: center; gap: 11px; padding: 8px 12px;
  border-radius: 7px; cursor: pointer; }
.fr-kbar-row.active, .fr-kbar-row:hover,
.fr-kbar-ask.active, .fr-kbar-ask:hover { background: var(--surface-2); }
.fr-kbar-row-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  background: var(--surface-2); color: var(--brand-primary);
  display: flex; align-items: center; justify-content: center; }
.fr-kbar-row.active .fr-kbar-row-icon, .fr-kbar-row:hover .fr-kbar-row-icon,
.fr-kbar-ask.active .fr-kbar-row-icon, .fr-kbar-ask:hover .fr-kbar-row-icon { background: var(--surface); }
.fr-kbar-row-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fr-kbar-row-text { flex: 1 1 auto; min-width: 0; }
.fr-kbar-row-title { font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-kbar-row-sub { font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-kbar-ask-hint { margin-left: auto; flex-shrink: 0; font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.fr-kbar-divider { height: 1px; background: var(--border); margin: 5px 6px; }

/* ---------- Home (centered, modern enterprise layout) ---------- */
.landing { display: flex; flex-direction: column; align-items: center; min-height: 0;
  padding: 64px 48px 28px; text-align: center; max-width: 1100px; margin: 0 auto; width: 100%; }
.landing-icon { display: none; }
/* Greeting + subhead removed — consumer-chatbot feel, not enterprise. */
.landing-greeting, .fr-subhead { display: none !important; }
.landing .search-shell { margin: 0 auto; width: 100%; max-width: 760px; }
.landing .quick-chips { justify-content: center; margin-top: 16px; max-width: 920px; }

.fr-seclabel { font-size: 12px; font-weight: 700; letter-spacing: .7px; color: var(--text-muted);
  margin: 40px auto 14px; max-width: 1000px; width: 100%; text-align: left; }
.fr-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px;
  max-width: 1000px; margin: 0 auto; width: 100%; }
.fr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; box-shadow: var(--shadow); text-align: left; font-family: var(--font);
  transition: transform .15s, box-shadow .15s; }
.fr-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.fr-tile { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2);
  color: var(--brand-primary); display: flex; align-items: center; justify-content: center; margin-bottom: 13px; }
.fr-tile svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fr-card h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.fr-card p { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 0; }

.fr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 15px;
  max-width: 1100px; margin: 0 auto; width: 100%; }
.fr-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-align: left; }
.fr-kpi-link { font-family: var(--font); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.fr-kpi-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand-primary) 30%, var(--border)); }
.fr-kpi-l { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.fr-kpi-n { font-size: 25px; font-weight: 750; color: var(--text); margin-top: 6px; letter-spacing: -.5px; }
.fr-kpi-n.fr-loading { color: var(--text-muted); font-weight: 500; font-size: 18px; }
.fr-kpi-s { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

.fr-recon { display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0; padding: 6px 12px;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  border-radius: 999px; font-size: 12.5px; color: var(--text); }
.fr-recon-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

/* ATPD / VelaTech back-charge drill-down modal */
.fr-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow: auto; }
.fr-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 720px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; overflow: hidden; }
.fr-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border); }
.fr-modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.fr-modal-head .fr-modal-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.fr-modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.fr-modal-close:hover { background: var(--surface-2); color: var(--text); }
.fr-modal-body { padding: 14px 22px 22px; overflow: auto; }
.fr-bc-total { display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 16px; background: var(--surface-2); border-radius: 10px; margin-bottom: 14px; }
.fr-bc-total .l { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.fr-bc-total .n { font-size: 26px; font-weight: 750; letter-spacing: -.4px; }
.fr-bc-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 9px 6px;
  border-bottom: 1px solid var(--border); align-items: center; }
.fr-bc-row:last-child { border-bottom: none; }
.fr-bc-row .v { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.fr-bc-row .n { font-size: 13.5px; color: var(--text); margin-top: 1px; }
.fr-bc-row .a { font-size: 14px; font-weight: 700; color: var(--text); text-align: right; white-space: nowrap; }
.fr-bc-row .flag { font-size: 11px; color: var(--warn); margin-top: 3px; }

/* footer breathing room (clears the rail via body padding) */
.app-footer { margin-top: 44px; }

/* Hide the legacy "IT Dashboard" pill on home — the Quick Access card replaces it. */
body:has(.fr-rail) #quick-chips .dash-link-btn { display: none; }

/* Teams-style "..." (overflow) button next to the user avatar — Settings entry point. */
.fr-more-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: none; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: color 0.15s, background 0.15s;
}
.fr-more-btn:hover { color: var(--brand-primary); background: var(--surface-2); }
.fr-more-btn:active { transform: scale(0.94); }

/* Teams-style overflow dropdown menu — anchored under the "..." button. */
.fr-omenu-anchor {
  position: relative;
  display: inline-flex;
}
.fr-omenu {
  position: fixed;
  top: 56px;
  right: 16px;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.fr-omenu[hidden] { display: none; }
.fr-omenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.fr-omenu-item:hover,
.fr-omenu-item:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.fr-omenu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--text-muted);
}
.fr-omenu-item:hover .fr-omenu-icon { color: var(--brand-primary); }
.fr-omenu-label {
  flex: 1 1 auto;
  white-space: nowrap;
}
.fr-omenu-kbd {
  font-size: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}
.fr-omenu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Person-card action button — danger variant for "Deactivate". */
.pr-action-btn.pr-action-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.pr-action-btn.pr-action-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.pr-action-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Settings opens FULL app-size (Teams-style) ─────────────────────────────
   The "…" menu stays a small dropdown, but Settings fills the content area to
   the right of the left rail and below the top bar — like Teams' settings page,
   easy to read. The rail + top bar stay visible and clickable. Scoped to
   #settings-modal so every other .modal (upload, etc.) keeps its centred look. */
#settings-modal.modal {
  inset: 54px 0 0 var(--fr-rail-w, 86px);   /* full app-size: below header, right of rail */
  padding: 0;
  background: var(--bg);
  display: block;
  backdrop-filter: none;
}
#settings-modal .settings-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: settingsFlyIn 0.14s ease-out;
}
#settings-modal .settings-sidebar { width: 240px; padding: 24px 16px; }
#settings-modal .settings-content { padding: 30px 42px; }

/* ── Forge landing pages (People / Locations / Reports) — structured cards ── */
.fl-wrap { max-width: 1180px; margin: 0 auto; padding: 26px 30px 56px; }
.fl-head { margin: 4px 0 4px; font-size: 23px; font-weight: 750; color: var(--text); letter-spacing: -0.01em; }
.fl-sub { font-size: 13.5px; color: var(--text-muted); margin: 0 0 24px; }
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 16px; }
.fl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px;
  cursor: pointer; text-align: left; width: 100%; font-family: inherit; display: block;
  transition: box-shadow .15s ease, transform .1s ease, border-color .15s ease; }
.fl-card:hover { box-shadow: 0 10px 28px rgba(16,24,40,.10);
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border)); transform: translateY(-1px); }
.fl-card:active { transform: translateY(0); }
.fl-card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--brand-primary); margin-bottom: 14px; }
.fl-card-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.fl-card-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.fl-card-desc { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 0; line-height: 1.45; }
.fl-card-stat { font-size: 27px; font-weight: 760; color: var(--text); margin-top: 14px; }
.fl-card-stat small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.fl-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 10px; display: flex; gap: 8px 14px; flex-wrap: wrap; }
.fl-card-arrow { float: right; color: var(--text-muted); }
.fl-empty { font-size: 13.5px; color: var(--text-muted); padding: 30px 0; }
@keyframes settingsFlyIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* Location record — "See who works here" people panel (added 2026-06-08) */
.lr-people-block { margin: 6px 0 20px; }
.lr-people-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: #0E2A6E; color: #fff; border: none; border-radius: 10px;
  padding: 13px 16px; font-size: 15px; font-weight: 650; cursor: pointer;
  transition: background .15s ease; font-family: inherit;
}
.lr-people-toggle:hover { background: #16387f; }
.lr-people-toggle .lr-people-toggle-label { flex: 1; text-align: left; }
.lr-people-toggle .lr-chev { transition: transform .18s ease; flex: none; }
.lr-people-toggle.lr-open .lr-chev { transform: rotate(180deg); }
.lr-people-panel {
  margin-top: 8px; border: 1px solid var(--border, #e6eaf3);
  border-radius: 10px; overflow: hidden;
}
.lr-person-row {
  display: grid; grid-template-columns: 1.2fr 1.3fr 1.5fr auto; gap: 12px;
  align-items: center; width: 100%; text-align: left; font-family: inherit;
  background: transparent; border: none; border-top: 1px solid var(--border, #f0f2f8);
  padding: 11px 16px; cursor: pointer; font-size: 13.5px; color: var(--text);
}
.lr-person-row:first-child { border-top: none; }
.lr-person-row:hover { background: rgba(14, 42, 110, .05); }
.lr-pr-name { font-weight: 650; }
.lr-pr-pref { font-weight: 500; color: var(--text-muted); }
.lr-pr-title { color: var(--text-muted); }
.lr-pr-email { color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.lr-pr-badge {
  justify-self: end; font-size: 10.5px; text-transform: capitalize;
  border-radius: 9px; padding: 2px 9px; font-weight: 600; white-space: nowrap;
}
.lr-pr-badge--employee   { background: #e8eefc; color: #2945b8; }
.lr-pr-badge--seconded   { background: #fff2dc; color: #9a6a10; }
.lr-pr-badge--consultant { background: #eafbf1; color: #1a8a4a; }
.lr-people-empty { padding: 16px; color: var(--text-muted); font-size: 13.5px; }
.lr-wfh-note {
  background: #fff6e8; border: 1px solid #f3d9a8; color: #8a5a10;
  border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin: 2px 0 16px;
}
@media (max-width: 640px) {
  .lr-person-row { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .lr-pr-title, .lr-pr-email { grid-column: 1 / -1; }
}
