/* Intentionally minimal; main look is inlined in index.html as fallback */

html, body { height: 100%; }
* { box-sizing: border-box; }

/* Dual photo hover effect (Workday + Slack) */
/* ============================================
   Avatar System
   ============================================ */

/* Base avatar container */
.avatar-container {
  position: relative;
  flex-shrink: 0;
}

/* Avatar ring decoration */
.avatar-container::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.1) 50%, rgba(255, 215, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.avatar-container:hover::before {
  opacity: 1;
}

/* Dual photo hover effect (Workday + Slack) */
.avatar-dual-photo {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-dual-photo:hover {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 215, 0, 0.2);
  transform: scale(1.02);
}

.avatar-dual-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.avatar-dual-photo .workday-photo {
  opacity: 1;
  z-index: 1;
}

.avatar-dual-photo .slack-photo {
  opacity: 0;
  z-index: 2;
  transform: scale(1.05);
}

.avatar-dual-photo:hover .workday-photo {
  opacity: 0;
  transform: scale(0.95);
}

.avatar-dual-photo:hover .slack-photo {
  opacity: 1;
  transform: scale(1);
}

/* Single avatar styling */
.avatar {
  border-radius: 12px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar:hover {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 215, 0, 0.2);
  transform: scale(1.02);
}

/* Expanded card: dual photo matches avatar size */
.card.expanded .avatar-dual-photo {
  width: 108px !important;
  height: 108px !important;
}

.card.expanded .avatar-container::before {
  border-radius: 16px;
  inset: -4px;
}

/* ============================================
   DESIGN TOKENS - Typography & Spacing System
   ============================================ */
:root {
  /* Type Scale (1.2 ratio - Minor Third) */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 26px;
  --text-3xl: 32px;
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Letter Spacing */
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.04em;
  --tracking-widest: 0.08em;
  
  /* Spacing Scale (4px base unit) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Component-specific spacing */
  --card-padding: var(--space-4);
  --card-gap: var(--space-3);
  --section-gap: var(--space-6);
  --container-padding: var(--space-5);
  --header-gap: var(--space-4);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Legacy (for backwards compatibility) */
  --dr-name-font-size: var(--text-xs);
  --dr-title-font-size: var(--text-2xs);
}

/* ============================================
   Typography Utility Classes
   ============================================ */

/* -- Size utilities -- */
.text-2xs { font-size: var(--text-2xs); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

/* -- Weight utilities -- */
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* -- Line height utilities -- */
.leading-none { line-height: var(--leading-none); }
.leading-tight { line-height: var(--leading-tight); }
.leading-snug { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

/* -- Tracking utilities -- */
.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-wider { letter-spacing: var(--tracking-wider); }
.tracking-widest { letter-spacing: var(--tracking-widest); }

/* -- Semantic text styles (pre-composed) -- */
.heading-1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.heading-2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.heading-3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
}

.heading-4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
}

.body-lg {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.body {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.body-sm {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.caption {
  font-size: var(--text-2xs);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-wide);
}

.overline {
  font-size: var(--text-2xs);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

/* ============================================
   Spacing Utility Classes
   ============================================ */

/* -- Gap utilities -- */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* -- Padding utilities -- */
.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* -- Margin utilities -- */
.m-0 { margin: var(--space-0); }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }

.mt-0 { margin-top: var(--space-0); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* -- Border radius utilities -- */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   Button System
   ============================================ */

/* Base button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

/* Primary Button - Gold gradient CTA */
.btn-primary,
button.primary {
  background: linear-gradient(180deg, #FFD700 0%, #E5C200 100%);
  color: #0b1723;
  font-weight: var(--font-semibold);
  box-shadow: 
    0 2px 8px rgba(255, 215, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover,
button.primary:hover {
  background: linear-gradient(180deg, #FFE033 0%, #FFD700 100%);
  box-shadow: 
    0 4px 16px rgba(255, 215, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active,
button.primary:active {
  transform: translateY(0);
  box-shadow: 
    0 1px 4px rgba(255, 215, 0, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Secondary Button - Dark subtle */
.btn-secondary,
button.secondary {
  background: linear-gradient(180deg, #1f3347 0%, #1a2d43 100%);
  color: #e6edf3;
  border: 1px solid #324761;
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn-secondary:hover,
button.secondary:hover {
  background: linear-gradient(180deg, #263d54 0%, #203651 100%);
  border-color: #3d5a7a;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.btn-secondary:active,
button.secondary:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #1a2d43 0%, #152536 100%);
}

/* Ghost Button - Minimal/text style */
.btn-ghost,
button.ghost {
  background: transparent;
  color: #9fb3c8;
  border: none;
}

.btn-ghost:hover,
button.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e6edf3;
}

.btn-ghost:active,
button.ghost:active {
  background: rgba(255, 255, 255, 0.08);
}

/* Danger/Destructive Button */
.btn-danger,
button.danger {
  background: linear-gradient(180deg, #3d1f1f 0%, #2d1515 100%);
  color: #f87171;
  border: 1px solid #5c2828;
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn-danger:hover,
button.danger:hover {
  background: linear-gradient(180deg, #4d2525 0%, #3d1f1f 100%);
  border-color: #7c3333;
  color: #fca5a5;
  box-shadow: 
    0 2px 8px rgba(220, 38, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.btn-danger:active,
button.danger:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #2d1515 0%, #1f0f0f 100%);
}

/* Outline variants */
.btn-outline-primary {
  background: transparent;
  color: #FFD700;
  border: 1px solid #FFD700;
}

.btn-outline-primary:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  color: #f87171;
  border: 1px solid #f87171;
}

.btn-outline-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.15);
  transform: translateY(-1px);
}

/* Button sizes */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* Disabled state */
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Icon button (square) */
.btn-icon {
  padding: var(--space-2);
  aspect-ratio: 1;
}

/* Authentication and Layout Styles */
html {
  overflow-x: hidden;
  max-width: 100vw;
}

body { 
  font-family: 'Public Sans', Arial, sans-serif; 
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin: 0; 
  background: #0b1723; 
  color: #e6edf3;
  overflow-x: hidden;
  max-width: 100vw;
}

.container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: var(--container-padding);
  overflow-x: hidden;
  box-sizing: border-box;
  width: 100%;
}

/* Header with authentication */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--header-gap);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid #22344a;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.logo h1 {
  font-size: var(--text-3xl);
  margin: 0;
  font-weight: var(--font-normal);
  letter-spacing: var(--tracking-tight);
  color: #FFD700;
}

.auth-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.auth-section .auth-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.auth-section .delegation-info {
  font-size: var(--text-xs);
  color: #7b8c9e;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.auth-section .delegation-info span {
  cursor: pointer;
  transition: color 0.2s;
}

.auth-section .delegation-info:hover span {
  color: #FFD700;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid #324761;
  background: linear-gradient(180deg, #1f3347 0%, #1a2d43 100%);
  color: #e6edf3;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  letter-spacing: var(--tracking-wide);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-btn:hover {
  background: linear-gradient(180deg, #263d54 0%, #203651 100%);
  border-color: #3d5a7a;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #1a2d43 0%, #152536 100%);
}

.user-info {
  color: #9fb3c8;
  font-size: var(--text-sm);
}

/* Login required message */
.login-required {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.login-message {
  text-align: center;
  background: #0f2233;
  border: 1px solid #22344a;
  border-radius: 14px;
  padding: 40px;
  max-width: 400px;
}

.login-message h2 {
  margin: 0 0 16px 0;
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  color: #FFD700;
}

.login-message p {
  margin: 0 0 24px 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: #9fb3c8;
}

/* Main content */
.main-content {
  display: block;
}

.search-section {
  margin-bottom: var(--section-gap);
}

.search-box {
  display: flex;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--section-gap);
}

.search-box input {
  flex: 1;
  padding: 14px 16px 14px 44px; /* Extra left padding for search icon */
  border-radius: 12px;
  border: 1px solid #324761;
  background: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7c8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 14px center no-repeat,
    linear-gradient(180deg, #0a1a28 0%, #0f2233 100%);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.03);
  color: #e6edf3;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  transition: all 0.2s ease;
}

.search-box input::placeholder {
  color: #5a6b7e;
  font-weight: var(--font-normal);
}

.search-box input:hover {
  border-color: #3d5a7a;
  background: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b9caf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 14px center no-repeat,
    linear-gradient(180deg, #0c1e2e 0%, #112840 100%);
}

.search-box input:focus {
  outline: none;
  border-color: #FFD700;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(255, 215, 0, 0.15),
    0 0 20px rgba(255, 215, 0, 0.1);
  background: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 14px center no-repeat,
    linear-gradient(180deg, #0c1e2e 0%, #112840 100%);
}

.search-box input::placeholder {
  color: #5a6b7e;
  font-weight: var(--font-normal);
}

/* Primary search button - solid gold CTA */
.search-box button#searchBtn,
.search-box button[type="submit"] {
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #FFD700 0%, #E5C200 100%);
  color: #0b1723;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  box-shadow: 
    0 2px 8px rgba(255, 215, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.search-box button#searchBtn:hover,
.search-box button[type="submit"]:hover {
  background: linear-gradient(180deg, #FFE033 0%, #FFD700 100%);
  box-shadow: 
    0 4px 16px rgba(255, 215, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.search-box button#searchBtn:active,
.search-box button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 
    0 1px 4px rgba(255, 215, 0, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Secondary buttons in search box (non-search) */
.search-box button:not(#searchBtn):not([type="submit"]):not(.history-icon-btn) {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #324761;
  background: #1a2d43;
  color: #e6edf3;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
}

.search-box button:not(#searchBtn):not([type="submit"]):not(.history-icon-btn):hover {
  background: #203651;
  border-color: #3d5a7a;
}

/* History icon button - inside search box on the left */
.history-icon-btn {
  padding: 8px 12px !important;
  border: none !important;
  background: transparent !important;
  color: #9fb3c8;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-icon-btn:hover {
  background: rgba(255, 215, 0, 0.1) !important;
  color: #FFD700;
  transform: scale(1.1);
}

.history-icon-btn:active {
  transform: scale(0.95);
}

/* Hide history button when no history available */
.history-icon-btn.hidden {
  display: none;
}

/* Typeahead dropdown */
.typeahead { position: relative; }
.typeahead-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: #0f2233; border: 1px solid #22344a; border-top: none; border-radius: 0 0 8px 8px; max-height: 260px; overflow-y: auto; box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
.typeahead-item { padding: 8px 10px; font-size: var(--text-sm); color: #e6edf3; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.typeahead-item:hover, .typeahead-item.active { background: #17334b; }
.typeahead-item .ti-name { font-weight: var(--font-semibold); }
.typeahead-item .ti-sub { font-size: var(--text-xs); color: #b9c3cf; }

/* Search history */
.typeahead-header { padding: 8px 10px; font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-widest); color: #7b8c9e; font-weight: var(--font-semibold); border-bottom: 1px solid #22344a; }
.history-item { padding: 8px 10px; font-size: var(--text-sm); color: #e6edf3; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.history-item:hover, .history-item.active { background: #17334b; }
.history-item .history-icon { font-size: var(--text-sm); flex-shrink: 0; }
.history-item .history-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typeahead-clear-history { padding: 8px 10px; font-size: var(--text-xs); color: #7b8c9e; cursor: pointer; text-align: center; border-top: 1px solid #22344a; }
.typeahead-clear-history:hover { background: #17334b; color: #b9c3cf; }

.status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.status {
  color: #9fb3c8;
  font-size: var(--text-sm);
}

.export-btn {
  background: transparent;
  border: 1px solid #5f748b;
  border-radius: var(--radius-sm);
  color: #9fb3c8;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 32px;
  height: 32px;
}

.export-btn:hover {
  background: rgba(255, 215, 0, 0.08);
  color: #FFD700;
  border-color: #FFD700;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15);
}

.export-btn:active {
  transform: translateY(0);
}

.export-btn svg {
  width: 16px;
  height: 16px;
}

/* Animated loading dots for NL search - Gold color */
.nl-loading-dots::after {
  content: '...';
  display: inline-block;
  width: 1.5em;
  animation: nl-loading-animation 1.5s infinite;
  letter-spacing: 2px;
  color: #FFD700; /* Axon Gold */
  font-weight: bold;
}

@keyframes nl-loading-animation {
  0% {
    content: '.';
  }
  33% {
    content: '..';
  }
  66% {
    content: '...';
  }
  100% {
    content: '.';
  }
}

/* Pulsing robot emoji for NL search */
.nl-loading-emoji {
  display: inline-block;
  animation: nl-emoji-pulse 1.5s ease-in-out infinite;
}

@keyframes nl-emoji-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  max-width: 100%;
  overflow: hidden;
}

.details { border-top: 1px solid #22344a; margin-top: 8px; padding-top: 8px; }

/* Card styling */
.card {
  position: relative;
  display: flex;
  gap: var(--card-gap);
  padding: var(--card-padding);
  border: 1px solid #22344a;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #132838 0%, #0f2233 40%, #0c1c2b 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s ease,
              background 0.25s ease;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Collapsed card hover effect - works on all cards including tenure-colored ones */
.card:not(.expanded):hover {
  border-color: #3d5a7a !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transform: translateY(-4px) !important;
}

/* Non-tenure cards get background change on hover */
.card:not(.expanded):not([class*="bg-"]):hover {
  background: linear-gradient(135deg, #162e40 0%, #112838 40%, #0e212f 100%);
}

/* Only show pointer cursor on collapsed cards (since they can be clicked to expand) */
.card:not(.expanded) {
  cursor: pointer;
  flex-direction: column;
}

/* Collapsed card content wrapper (avatar + meta side by side) */
.card:not(.expanded) .avatar-container,
.card:not(.expanded) .meta {
  /* These will be in a row via the card-content-row wrapper */
}

/* Team branding banner on collapsed cards - horizontal at top */
/* Collapsed card: subtle team branding strip */
.card:not(.expanded) .team-branding-banner {
  width: calc(100% + 32px);
  margin: -16px -16px 10px -16px !important;
  padding: 6px 12px !important;
  min-height: 28px !important;
  background: linear-gradient(135deg, rgba(26, 42, 58, 0.6) 0%, rgba(45, 74, 90, 0.4) 100%) !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  order: -1;
}

.card:not(.expanded) .team-branding-banner .team-branding-content {
  gap: 8px !important;
}

.card:not(.expanded) .team-branding-banner img {
  width: 24px !important;
  height: 24px !important;
  border-radius: 4px !important;
}

.card:not(.expanded) .team-branding-banner .team-branding-name {
  font-size: 11px !important;
  font-weight: 500 !important;
  opacity: 0.85;
}

/* Hide edit button and tooltip on collapsed cards */
.card:not(.expanded) .team-branding-edit-btn,
.card:not(.expanded) .team-branding-tooltip {
  display: none !important;
}

.card:hover {
  border-color: #324761;
}

.card.expanded {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-areas:
    "branding branding"
    "avatar meta"
    "details details"
    "story story"
    "directs directs"
    "peers peers"
    "coins coins"
    "charts charts";
  column-gap: var(--space-4);
  row-gap: var(--space-3);
  align-items: start;
  max-width: 100%;
  box-sizing: border-box;
  
  /* Enhanced expanded state */
  background: linear-gradient(135deg, #152d3d 0%, #112638 30%, #0d1f2d 70%, #0a1822 100%);
  border-color: #2a4560;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 0 0 1px rgba(255, 215, 0, 0.05) inset;
}

/* Team branding banner */
.team-branding-banner {
  grid-area: branding;
  overflow: visible;
  z-index: 10;
}

/* Expanded card: refined team branding banner */
.card.expanded .team-branding-banner {
  padding: 10px 16px !important;
  min-height: 44px !important;
  background: linear-gradient(135deg, #12202c 0%, #1a2d3d 50%, #0f1a24 100%) !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card.expanded .team-branding-banner img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Tooltip logo should be larger */
.card.expanded .team-branding-banner .team-branding-tooltip img {
  width: 96px !important;
  height: 96px !important;
  border-radius: 12px !important;
}

.card.expanded .team-branding-banner .team-branding-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

.card.expanded .team-branding-edit-btn {
  background: rgba(255, 215, 0, 0.1) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  color: #FFD700 !important;
  font-size: 11px !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

.card.expanded .team-branding-edit-btn:hover {
  background: rgba(255, 215, 0, 0.2) !important;
  border-color: rgba(255, 215, 0, 0.4) !important;
  transform: translateY(-1px);
}

/* Adjust team branding banner for mobile */
@media (max-width: 600px) {
  .team-branding-banner {
    padding: 8px 12px !important;
    margin: -12px -12px 10px -12px !important;
    min-height: 36px !important;
  }
  
  .card.expanded .team-branding-banner img {
    width: 28px !important;
    height: 28px !important;
  }
  
  .card.expanded .team-branding-banner .team-branding-name {
    font-size: 12px !important;
  }
  
  .team-branding-edit-btn {
    right: 44px !important;
    padding: 3px 8px !important;
    font-size: 10px !important;
  }
}

.card.expanded > * {
  min-width: 0; /* Prevents grid items from overflowing */
  box-sizing: border-box;
}

/* Card content layout */
.card .meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card .name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: #FFD700;
  margin: 0;
}

.card .subtle {
  color: #9fb3c8;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  margin: 0;
}

.card .row {
  font-size: var(--text-sm);
  color: #e6edf3;
  margin: 0;
  line-height: var(--leading-snug);
}

.card .row.tiny {
  font-size: var(--text-xs);
  color: #9fb3c8;
  line-height: var(--leading-snug);
}

.card .pronouns {
  color: #7f8ea3;
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
}
/* Section headers for exact/partial match groups */
.section-header { 
  margin: var(--space-5) var(--space-1) var(--space-2); 
  color: #9fb3c8; 
  font-size: var(--text-xs); 
  font-weight: var(--font-semibold);
  text-transform: uppercase; 
  letter-spacing: var(--tracking-wider); 
  grid-column: 1 / -1; 
}
.section-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.block-results { display: block; }

/* Tenure backgrounds (applied when worker type is Employee). Use higher specificity + !important
   to override inline fallback styles defined in index.html */
/* Tenure-based card backgrounds - lightest to darkest gold spectrum */
/* 135° diagonal gradient (top-left to bottom-right) for natural lighting */
.card.bg-black { 
  background: linear-gradient(135deg, #FFFFF0 0%, #FFF8DC 50%, #F5E6B8 100%) !important; 
  border-color: #D4C896 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.8), inset 0 -2px 4px rgba(0, 0, 0, 0.03) !important;
}
.card.bg-lightblue { 
  background: linear-gradient(135deg, #FFF8CC 0%, #FFEB99 50%, #F5D966 100%) !important; 
  border-color: #D4B84D !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 4px rgba(0, 0, 0, 0.05) !important;
}
.card.bg-yellow { 
  background: linear-gradient(135deg, #FFE866 0%, #FFD700 50%, #E6B800 100%) !important; 
  border-color: #C99F00 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.08) !important;
}
.card.bg-red { 
  background: linear-gradient(135deg, #FFD633 0%, #E6B800 50%, #CC9F00 100%) !important; 
  border-color: #B38600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 4px rgba(0, 0, 0, 0.1) !important;
}
.card.bg-purple { 
  background: linear-gradient(135deg, #E6B800 0%, #CC9900 50%, #A67C00 100%) !important; 
  border-color: #8F6B00 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 4px rgba(0, 0, 0, 0.12) !important;
}
.card.bg-silver { 
  background: linear-gradient(135deg, #BF8F00 0%, #996600 50%, #735200 100%) !important; 
  border-color: #5C4200 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.15) !important;
}
.card.bg-gold { 
  background: linear-gradient(135deg, #8B6914 0%, #664400 50%, #4D3300 100%) !important; 
  border-color: #3D2600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.15), inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Tenure card hover - lift and glow */
.card.bg-black:not(.expanded):hover,
.card.bg-lightblue:not(.expanded):hover,
.card.bg-yellow:not(.expanded):hover,
.card.bg-red:not(.expanded):hover,
.card.bg-purple:not(.expanded):hover,
.card.bg-silver:not(.expanded):hover,
.card.bg-gold:not(.expanded):hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

/* Title color */
.title { color: #FFD700 !important; }

/* Header/logo */
.header { display: flex; align-items: center; gap: 12px; }
.header h1 { font-size: 2.25rem; margin: 0; font-weight: 300; }
.logo { height: 5.0625rem; width: auto; border-radius: 6px; }

/* Avatar fallback */
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  color: #FFD700;
  font-weight: var(--font-bold);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-wide);
  border-radius: 12px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 215, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-fallback:hover {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(1.02);
}

/* Direct reports section */
.dr-list { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.dr-item { 
  width: 84px; 
  text-align: center; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dr-item:hover {
  transform: translateY(-3px);
}

.dr-avatar {
  width: 56px; 
  height: 56px; 
  border-radius: var(--radius-md);
  display: flex; 
  align-items: center; 
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  color: #FFD700 !important; 
  font-weight: var(--font-bold); 
  font-size: var(--text-lg);
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.dr-item:hover .dr-avatar {
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(255, 215, 0, 0.3);
  transform: scale(1.08);
}

.dr-item img { 
  display: block; 
  margin: 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
}

.dr-item:hover img {
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(255, 215, 0, 0.3);
  transform: scale(1.08);
}
.avatar { object-fit: cover !important; }

/* Enlarge main photo when card is expanded (72px -> 108px) */
.card.expanded .avatar { grid-area: avatar; width: 108px !important; height: 108px !important; margin: 0; }
.card.expanded .avatar-container > div { width: 108px !important; height: 108px !important; }
.card.expanded .meta { grid-area: meta; width: 100%; }
.card.expanded .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
  align-content: start;
}
.card.expanded .meta .name,
.card.expanded .meta .subtle { grid-column: 1 / -1; }
.card.expanded .details { grid-area: details; display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px 16px; }
/* Ensure large sections span the full width below the two-column detail grid */
.card.expanded .charts-section .level-chart,
.card.expanded .charts-section .family-chart,
.card.expanded .charts-section .location-chart,
.card.expanded .charts-section .country-chart,
.card.expanded .charts-section .managers-chart,
.card.expanded .charts-section .worker-type-chart,
.card.expanded .directs-section .dr-header,
.card.expanded .directs-section .dr-list { grid-column: 1 / -1; }

/* Visual separation between charts on expanded cards */
/* Base spacing for chart sections */
.card.expanded .charts-section .level-chart,
.card.expanded .charts-section .family-chart,
.card.expanded .charts-section .country-chart,
.card.expanded .charts-section .location-chart,
.card.expanded .charts-section .managers-chart,
.card.expanded .charts-section .worker-type-chart {
  margin-top: 8px;
}

/* Strong visual separator ONLY between consecutive charts */
.card.expanded .charts-section :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart)
  + :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart) {
  margin-top: 10px;
  padding-top: 8px;
}
.card.expanded .charts-section :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart)
  + :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart)::before {
  content: '';
  display: block;
  height: 1px;
  background-color: rgba(95, 116, 139, 0.35); /* subtle neutral divider */
  border-radius: 0;
  margin-bottom: 8px;
}
/* Tighten topmost chart so it doesn't double-space with previous content */
.card.expanded .charts-section .level-chart:first-of-type {
  margin-top: 6px;
}
/* Job Family chart reuses level chart row styles */
.family-chart { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.family-chart > div:first-child { font-size: var(--text-xs); color: #5a6b7e; text-transform: uppercase; letter-spacing: var(--tracking-wider); font-weight: var(--font-semibold); margin-bottom: 2px; }
/* Countries chart matches family/level chart layout */
.country-chart { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.country-chart > div:first-child { font-size: var(--text-xs); color: #5a6b7e; text-transform: uppercase; letter-spacing: var(--tracking-wider); font-weight: var(--font-semibold); margin-bottom: 2px; }
/* Locations chart matches family/level chart layout */
.location-chart { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.location-chart > div:first-child { font-size: var(--text-xs); color: #5a6b7e; text-transform: uppercase; letter-spacing: var(--tracking-wider); font-weight: var(--font-semibold); margin-bottom: 2px; }
/* Managers vs Creators chart matches family/level chart layout */
.managers-chart { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.managers-chart > div:first-child { font-size: var(--text-xs); color: #5a6b7e; text-transform: uppercase; letter-spacing: var(--tracking-wider); font-weight: var(--font-semibold); margin-bottom: 2px; }
/* Worker Type chart matches family/level chart layout */
.worker-type-chart { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.worker-type-chart > div:first-child { font-size: var(--text-xs); color: #5a6b7e; text-transform: uppercase; letter-spacing: var(--tracking-wider); font-weight: var(--font-semibold); margin-bottom: 2px; }

/* Mobile: use a softer divider and smaller spacing */
@media (max-width: 720px) {
  .card.expanded .charts-section .level-chart,
  .card.expanded .charts-section .family-chart,
  .card.expanded .charts-section .country-chart,
  .card.expanded .charts-section .location-chart,
  .card.expanded .charts-section .managers-chart,
  .card.expanded .charts-section .worker-type-chart {
    margin-top: 8px;
  }
  .card.expanded .charts-section :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart)
    + :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart) {
    margin-top: 10px;
    padding-top: 8px;
  }
  .card.expanded .charts-section :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart)
    + :is(.level-chart, .family-chart, .country-chart, .location-chart, .managers-chart, .worker-type-chart)::before {
    height: 1px;
    background-color: rgba(95, 116, 139, 0.28);
    margin-bottom: 6px;
  }
}

/* Extra space before Direct Reports label for readability */
.card.expanded .directs-section .dr-header { margin-top: 14px; }

/* Hover effect for clickable Achievement Coins header only */
.card.expanded .directs-section .dr-header.clickable-header:hover { 
  color: #FF6B35;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .card.expanded .details { grid-template-columns: 1fr; }
  
  /* Move time display below collapse button on mobile */
  .local-time-display {
    top: 52px !important;
    right: 12px !important;
  }
}
.dr-avatar { margin: 0 auto; }
.dr-name { 
  margin-top: 4px; 
  font-size: var(--dr-name-font-size); 
  line-height: var(--leading-tight); 
  font-weight: var(--font-bold);
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: color 0.2s ease;
}

/* Hover text color - dark for light tenure backgrounds, gold for dark backgrounds */
.dr-item:hover .dr-name {
  color: #FFD700;
}

/* Override for light tenure backgrounds (gold spectrum) */
.card.bg-black .dr-item:hover .dr-name,
.card.bg-lightblue .dr-item:hover .dr-name,
.card.bg-yellow .dr-item:hover .dr-name,
.card.bg-red .dr-item:hover .dr-name {
  color: #1a0a00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Override for medium tenure backgrounds */
.card.bg-purple .dr-item:hover .dr-name,
.card.bg-silver .dr-item:hover .dr-name {
  color: #000000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Light contingent worker backgrounds */
.card.bg-cw-palesky .dr-item:hover .dr-name,
.card.bg-cw-softazure .dr-item:hover .dr-name {
  color: #003366;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.dr-title { 
  font-size: var(--dr-title-font-size); 
  line-height: var(--leading-snug); 
  opacity: 0.9;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dr-level {
  font-size: var(--dr-title-font-size);
  line-height: var(--leading-tight);
  opacity: 0.85;
  font-weight: var(--font-semibold);
  width: 100%;
}
.dr-org { 
  font-size: var(--dr-title-font-size); 
  line-height: var(--leading-tight); 
  font-family: inherit; 
  font-weight: inherit;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Achievement Coins section */
.achievement-coins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--coin-size, 96px), var(--coin-size, 96px)));
  gap: 16px;
  margin-top: 8px;
  grid-column: 1 / -1;
  position: relative; /* Establish positioning context for tooltips */
}

.achievement-coin-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.achievement-coin {
  width: var(--coin-size, 96px);
  height: var(--coin-size, 96px);
  position: relative;
  cursor: help;
  transition: transform 0.2s ease;
}

.achievement-coin:hover {
  transform: scale(1.1);
}

.achievement-coin-label {
  font-size: 12px;
  font-weight: 700;
  color: #000000;
  text-align: center;
  line-height: 1.2;
  max-width: var(--coin-size, 96px);
  word-wrap: break-word;
}

.achievement-coin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.achievement-coin-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: #FFD700;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: normal;
  min-width: 200px;
  max-width: min(350px, 90vw); /* Responsive max width */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  margin-bottom: 8px;
  z-index: 99999;
  border: 1px solid #FFD700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); /* Better visibility */
}

/* Left-align tooltip for leftmost coins to prevent left edge clipping */
.achievement-coin:first-child .achievement-coin-tooltip,
.achievement-coin:nth-child(2) .achievement-coin-tooltip {
  left: 0;
  right: auto;
  transform: translateX(0);
}

/* Right-align tooltip for rightmost coins to prevent right edge clipping */
.achievement-coin:last-child .achievement-coin-tooltip,
.achievement-coin:nth-last-child(2) .achievement-coin-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.achievement-coin:hover .achievement-coin-tooltip {
  opacity: 1;
}

.achievement-coin-tooltip-name {
  font-weight: 700;
  margin-bottom: 2px;
}

.achievement-coin-tooltip-description {
  font-size: 10px;
  opacity: 0.7;
  font-style: italic;
  margin-bottom: 4px;
  line-height: 1.3;
}

.achievement-coin-tooltip-date {
  font-size: 10px;
  opacity: 0.8;
}

/* Employees per Manager tooltip */
.employees-ratio-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-bottom: 4px;
  z-index: 1000;
}

div:hover > .employees-ratio-tooltip {
  opacity: 1;
}

/* Creators per Manager tooltip */
.creators-ratio-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-bottom: 4px;
  z-index: 1000;
}

div:hover > .creators-ratio-tooltip {
  opacity: 1;
}

/* Ensure achievement coins grid spans full width */
.card.expanded .details .achievement-coins-grid {
  grid-column: 1 / -1;
}

/* Clickable text utility */
.clickable { text-decoration: underline; cursor: pointer; }
/* Make manager clickable text and email links the same blue for clarity */
.card .row a { color: #1E90FF !important; text-decoration: underline; }
.clickable { color: #1E90FF !important; }

/* Management Chain Tooltip */
.management-chain-container {
  position: relative;
  display: inline-block;
}

.management-chain-icon {
  cursor: pointer;
  font-size: 14px;
  color: #1E90FF;
  margin-left: 4px;
  user-select: none;
  display: none; /* Hidden on desktop */
  transition: transform 0.2s ease;
}

.management-chain-icon:hover {
  transform: scale(1.2);
}

.management-chain-tooltip {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 8px;
  background: white;
  border: 2px solid #1E90FF;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px;
  min-width: 280px;
  max-width: 400px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.management-chain-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.management-chain-header {
  font-weight: 700;
  font-size: 13px;
  color: #0b1723;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.management-chain-item {
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid transparent;
}

.management-chain-item:hover {
  background-color: #f0f8ff;
  border-color: #1E90FF;
}

.management-chain-name {
  font-weight: 700;
  font-size: 13px;
  color: #0b1723;
  margin-bottom: 2px;
}

.management-chain-title {
  font-size: 11px;
  color: #5a6b7e;
  font-style: italic;
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .management-chain-tooltip {
    min-width: 240px;
    max-width: 90vw;
    left: auto;
    right: 0;
  }
  
  .management-chain-icon {
    display: inline-block; /* Show icon on mobile */
    font-size: 16px;
    padding: 4px;
  }
}

/* Nested level results grid should span full width under a card */
.level-results {
  grid-column: 1 / -1;
  border: 1px solid #22344a; /* fallback; JS will override color to match parent card */
  border-radius: 14px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 10px;
  margin: 0 0 0 0; /* connector handles spacing */
}

/* Small centered connector between card and level list */
.level-connector {
  grid-column: 1 / -1;
  position: relative;
  height: 18px;
  margin: 6px 0 0 0;
}

/* Contingent worker tenure backgrounds */
/* Contingent worker card backgrounds - blue spectrum */
/* 135° diagonal gradient (top-left to bottom-right) for natural lighting */
.card.bg-cw-palesky { 
  background: linear-gradient(135deg, #FFFFFF 0%, #E6F2FF 50%, #CCE5FF 100%) !important; 
  border-color: #99C2E6 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.8), inset 0 -2px 4px rgba(0, 0, 0, 0.03) !important;
}
.card.bg-cw-softazure { 
  background: linear-gradient(135deg, #E6F2FF 0%, #B3D9FF 50%, #80C0FF 100%) !important; 
  border-color: #4DA6FF !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 4px rgba(0, 0, 0, 0.05) !important;
}
.card.bg-cw-anchor { 
  background: linear-gradient(135deg, #66B3FF 0%, #1E90FF 50%, #0066CC 100%) !important; 
  border-color: #004C99 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.1) !important;
}
.card.bg-cw-deepazure { 
  background: linear-gradient(135deg, #3399FF 0%, #0066CC 50%, #004C99 100%) !important; 
  border-color: #003D7A !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.12) !important;
}
.card.bg-cw-royal { 
  background: linear-gradient(135deg, #0080CC 0%, #004C99 50%, #003366 100%) !important; 
  border-color: #00264D !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 4px rgba(0, 0, 0, 0.15) !important;
}
.card.bg-cw-navy { 
  background: linear-gradient(135deg, #0066A3 0%, #003366 50%, #001A33 100%) !important; 
  border-color: #00101F !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.15), inset 0 -2px 4px rgba(0, 0, 0, 0.18) !important;
}
.card.bg-cw-midnight { 
  background: linear-gradient(135deg, #003D66 0%, #001933 50%, #000D1A 100%) !important; 
  border-color: #000508 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Contingent worker card hover - lift and glow */
.card.bg-cw-palesky:not(.expanded):hover,
.card.bg-cw-softazure:not(.expanded):hover,
.card.bg-cw-anchor:not(.expanded):hover,
.card.bg-cw-deepazure:not(.expanded):hover,
.card.bg-cw-royal:not(.expanded):hover,
.card.bg-cw-navy:not(.expanded):hover,
.card.bg-cw-midnight:not(.expanded):hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Card text: dark, no shadow */
.card { color: #0b1723 !important; }
.card .name,
.card .subtle,
.card .row,
.card .details {
  color: #0b1723 !important;
  text-shadow: none;
  -webkit-text-stroke: 0;
  text-stroke: 0;
}

/* 30+ years: gold text for visibility */
.card.bg-gold,
.card.bg-gold .name,
.card.bg-gold .subtle,
.card.bg-gold .row,
.card.bg-gold .details,
.card.bg-cw-midnight,
.card.bg-cw-midnight .name,
.card.bg-cw-midnight .subtle,
.card.bg-cw-midnight .row,
.card.bg-cw-midnight .details {
  color: #FFD700 !important;
}

/* Show pronouns next to the name in expanded view */
.card.expanded .pronouns { display: inline; margin-left: 4px; }


/* Employee Levels horizontal bar chart */
.level-chart {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.level-chart > div:first-child { /* header text */
  font-size: 12px;
  color: #5a6b7e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.level-row {
  display: grid;
  grid-template-columns: auto 240px 1fr auto; /* checkbox, label, bar, count */
  align-items: center;
  gap: 12px;
}
.level-label {
  justify-self: start;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: #0b1723 !important; /* override generic clickable blue */
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  white-space: nowrap;           /* keep on one line */
  overflow: hidden;              /* avoid wrapping */
  text-overflow: ellipsis;       /* truncate if too long */
  min-width: 0;                  /* allow shrink inside CSS grid to avoid overflow */
  padding-right: 8px;            /* spacing from the bar column */
  display: inline-block;         /* clip underline to actual text width */
  max-width: 100%;
}
.level-bar {
  position: relative;
  height: 8px; /* shorter bars */
  background: #e9eef5;
  border: 1px solid #d4dbe6;
  border-radius: 4px;
  overflow: hidden;
}
.level-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #E09500; /* Axon orange-like */
  transform: none; /* render exact percentage width set via style */
}
.level-count {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: #5a6b7e;
  white-space: nowrap;
}

/* Mobile layout: keep desktop the same; optimize for small screens */
@media (max-width: 600px) {
  .container { padding: 14px; }
  /* Keep header as a row, put a small Sign Out on the right */
  header { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 4px; padding-bottom: 4px; }
  .logo h1 { font-size: 1.5rem; }
  .auth-section { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
  #statsBtn { display: none !important; }
  .user-info { display: none !important; }
  #logoutBtn { padding: 6px 10px; font-size: 12px; line-height: 1; }

  /* Search button small and to the right of the input */
  .search-box { flex-direction: row; gap: 8px; margin: 2px 0 8px; }
  .search-box input { font-size: 16px; padding: 12px 12px 12px 40px; }
  .search-box button#searchBtn { width: auto; font-size: 14px; padding: 12px 16px; }

  .results { grid-template-columns: 1fr; gap: 12px; }
  .section-grid { grid-template-columns: 1fr; gap: 12px; }

  .card { padding: 12px; gap: 12px; }
  .card .name { font-size: 16px; }
  .card .row { font-size: 12px; }

  .card.expanded { 
    grid-template-columns: 1fr !important; 
    grid-template-areas:
      'branding'
      'avatar'
      'meta'
      'details'
      'story'
      'directs'
      'peers'
      'coins'
      'charts';
    column-gap: 0;
  }
  .card.expanded .avatar { 
    width: 88px !important; 
    height: 88px !important;
    justify-self: center; /* Center the avatar on mobile */
  }
  .card.expanded .avatar-container > div { width: 88px !important; height: 88px !important; }
  .card.expanded .avatar-dual-photo { width: 88px !important; height: 88px !important; }
  .card.expanded .meta { grid-template-columns: 1fr !important; gap: 6px; }
  .card.expanded .details { grid-template-columns: 1fr !important; }
  .card.expanded > * { max-width: 100%; }

  .dr-list { flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding-bottom: 4px; }
  .dr-item { width: 72px; }
  .dr-avatar { width: 52px; height: 52px; }

  .level-row { grid-template-columns: auto 160px 1fr auto; gap: 8px; }
  .level-label { font-size: 12px; }
  
  /* Make status more compact on mobile */
  #status { 
    font-size: 13px; 
    margin-bottom: 10px;
    line-height: 1.4;
  }
}

/* iPhone Pro Max-ish widths (≤440px) */
@media (max-width: 440px) {
  .container { padding: 14px; }
  header { gap: 8px; }
  header img { max-height: 40px; }
  .logo h1 { font-size: 1.25rem; }
  .user-info { width: 100%; font-size: 12px; line-height: 1.3; white-space: normal; word-break: break-word; }
  .auth-btn { width: 100%; }

  .results, .section-grid { gap: 10px; }
  .section-header { font-size: 12px; margin: 14px 2px 6px; }

  .card { padding: 10px; gap: 10px; }
  .card .name { font-size: 15px; }
  .card .row { font-size: 11.5px; }
  .slack-status-text { font-size: 11px !important; }
  .card.expanded .avatar { width: 84px !important; height: 84px !important; }
  .card.expanded .avatar-container > div { width: 84px !important; height: 84px !important; }
  .card.expanded .avatar-dual-photo { width: 84px !important; height: 84px !important; }
  .card.expanded .meta { grid-template-columns: 1fr !important; gap: 6px; }
  .card.expanded .details { grid-template-columns: 1fr !important; }

  .dr-list { gap: 8px; }
  .dr-item { width: 64px; }
  .dr-avatar { width: 48px; height: 48px; }

  .level-row { grid-template-columns: auto 150px 1fr auto; gap: 8px; }
  .level-label { font-size: 12px; }
}

/* iPhone 14/15 (≈393px) and narrower */
@media (max-width: 400px) {
  .container { padding: 12px; }
  header img { max-height: 36px; }
  .logo h1 { font-size: 1.1rem; }
  .auth-btn { padding: 9px 10px; font-size: 14px; }
  .user-info { font-size: 11.5px; }

  .search-box input { font-size: 15px; padding: 10px 12px; }
  .search-box button { font-size: 15px; padding: 10px 12px; }

  .card { padding: 10px; }
  .card .name { font-size: 14.5px; }
  .card .row { font-size: 11px; }
  .slack-status-text { font-size: 10.5px !important; }
  .card.expanded .avatar { width: 78px !important; height: 78px !important; }
  .card.expanded .avatar-container > div { width: 78px !important; height: 78px !important; }
  .card.expanded .avatar-dual-photo { width: 78px !important; height: 78px !important; }
  .card.expanded .meta { grid-template-columns: 1fr !important; }
  .card.expanded .details { grid-template-columns: 1fr !important; }

  .dr-item { width: 60px; }
  .dr-avatar { width: 46px; height: 46px; }

  .level-row { grid-template-columns: auto 140px 1fr auto; gap: 6px; }
  .level-count { font-size: 11px; }
}

.contingent-override,
.contingent-override a,
.card .row .contingent-override,
.card .row .contingent-override a {
  color: #000 !important;
  text-decoration: underline !important;
}

/* Coin Holders Modal */
.coin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 23, 35, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.coin-modal {
  background: linear-gradient(135deg, #0f2233 0%, #1a2f42 100%);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 215, 0, 0.1);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.coin-modal-header {
  display: flex;
  align-items: center;
  padding: 28px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  flex-shrink: 0;
  background: rgba(255, 215, 0, 0.03);
}

.coin-modal-header h2 {
  flex: 1;
  color: #FFD700;
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.coin-modal-close {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #FFD700;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 300;
}

.coin-modal-close:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
  transform: scale(1.05);
}

.coin-modal-subtitle {
  padding: 18px 28px;
  color: #b8c5d6;
  font-size: var(--text-base);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  flex-shrink: 0;
  font-weight: 500;
}

.coin-holders-list {
  overflow-y: auto;
  padding: 20px 28px;
  flex: 1;
}

.coin-holders-list::-webkit-scrollbar {
  width: 10px;
}

.coin-holders-list::-webkit-scrollbar-track {
  background: rgba(15, 34, 51, 0.4);
  border-radius: 5px;
}

.coin-holders-list::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 5px;
}

.coin-holders-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.5);
}

.coin-holder-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px;
  background: rgba(15, 34, 51, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 10px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.coin-holder-item:last-child {
  margin-bottom: 0;
}

.coin-holder-item:hover {
  background: rgba(15, 34, 51, 0.8);
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
}

.coin-holder-name {
  font-weight: var(--font-bold);
  font-size: var(--text-base);
  color: #e6edf3;
  margin-bottom: 6px;
}

.coin-holder-details {
  font-size: var(--text-sm);
  color: #8b9ab0;
  line-height: var(--leading-relaxed);
}

.coin-holder-details .coin-holder-title {
  display: block;
  margin-bottom: 2px;
  color: #b8c5d6;
}

.coin-holder-details .coin-holder-date {
  display: block;
  color: #FFD700;
  font-style: italic;
  font-size: 13px;
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .coin-modal {
    max-height: 90vh;
    margin: 10px;
    border-width: 1px;
  }
  
  .coin-modal-header {
    padding: 20px;
  }
  
  .coin-modal-header h2 {
    font-size: 22px;
  }
  
  .coin-modal-subtitle {
    padding: 14px 20px;
  }
  
  .coin-holders-list {
    padding: 16px 20px;
  }
  
  .coin-holder-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }
}

/* Sort Group Separator */
.sort-group-separator {
  grid-column: 1 / -1;
  padding: 10px 16px;
  margin: 16px 0 10px 0;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0%, rgba(255, 215, 0, 0.03) 100%);
  border-left: 3px solid rgba(139, 154, 176, 0.4);
  border-radius: 4px;
  color: #8b9ab0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(139, 154, 176, 0.15);
  border-left: 3px solid rgba(139, 154, 176, 0.4);
}

/* Mobile adjustments for sort separator */
@media (max-width: 720px) {
  .sort-group-separator {
    font-size: 12px;
    padding: 8px 12px;
    margin: 12px 0 8px 0;
    letter-spacing: 0.6px;
  }
}

/* Filter Status Bar */
.filter-status-bar {
  padding: 16px 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f1923 100%);
  border-bottom: 2px solid #FFD700;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.filter-badges-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sort-dropdown-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sort-label {
  color: #b0c4de;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.sort-select {
  background: linear-gradient(135deg, #2a4563 0%, #1a2f42 100%);
  color: #FFD700;
  border: 1px solid #FFD700;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  outline: none;
}

.sort-select:hover {
  background: linear-gradient(135deg, #3a5573 0%, #2a3f52 100%);
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.clear-filters-btn {
  background: linear-gradient(135deg, #ff4757 0%, #dc3545 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
  flex-shrink: 0;
}

.clear-filters-btn:hover {
  background: linear-gradient(135deg, #ff6b7a 0%, #ff4757 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6);
}

.export-csv-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.export-csv-btn:hover {
  background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);
}

.export-csv-btn svg {
  flex-shrink: 0;
}

/* Export-only bar (when no filters active) */
.filter-status-bar.export-only {
  padding: 12px 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f1923 100%);
  border-bottom: 2px solid #FFD700;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments for filter bar */
@media (max-width: 720px) {
  .filter-status-bar {
    padding: 12px 14px;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-badges-container {
    gap: 8px;
    width: 100%;
  }
  
  .sort-dropdown-container {
    width: 100%;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
  }
  
  .sort-label {
    font-size: 12px;
  }
  
  .sort-select {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .clear-filters-btn {
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 13px;
  }
  
  .export-csv-btn {
    display: none; /* Hide export button on mobile */
  }
  
  .filter-status-bar.export-only {
    display: none; /* Hide export-only bar on mobile since it only contains export button */
  }
}
/* PhoneTool Admin Override Styling */
.admin-override-indicator {
  color: #FFD700 !important;
  font-style: italic !important;
  position: relative;
}

.admin-override-indicator::after {
  content: " ✏️";
  font-style: normal;
  font-size: 0.9em;
  opacity: 0.7;
}

.admin-override-badge {
  display: inline-block;
  background: #B8860B;
  color: #000;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 6px;
  font-style: normal;
}

/* Story Section Styling */
.story-section {
  grid-area: story;
  margin: 12px 0 20px 0;
  padding: 16px;
  border: 1px solid rgba(95, 116, 139, 0.3);
  border-radius: 8px;
  background: rgba(95, 116, 139, 0.04);
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.story-header {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  font-weight: 600;
  visibility: visible !important;
}

.story-header-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.story-edit-btn {
  padding: 4px 12px;
  background: #FFD700;
  color: #0b1723;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.story-edit-btn:hover {
  background: #FFC700;
}

.story-delete-btn {
  padding: 4px 12px;
  background: transparent;
  color: #495057;
  border: 1px solid #6c757d;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-delete-btn:hover {
  background: #495057;
  color: #ffffff;
  border-color: #495057;
}

.story-done-btn {
  padding: 6px 16px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
  margin-left: auto;
}

.story-done-btn:hover {
  background: #45a049;
}

.story-content {
  font-size: 14px;
  line-height: 1.6;
  color: #0b1723;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  min-height: 60px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  display: block !important;
  visibility: visible !important;
  max-width: 100%;
  box-sizing: border-box;
}

.story-content.editing {
  border: 2px solid #9fb3c8;
  cursor: text;
  background: rgba(255, 255, 255, 0.12);
}

.story-content.editing:focus {
  outline: none;
  border-color: #FFD700;
}

.story-content em {
  color: #7f8ea3;
}

.story-content a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 500;
}

.story-content a:hover {
  color: #004499;
  text-decoration: underline;
}

.story-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.story-toolbar button {
  padding: var(--space-1) var(--space-3);
  background: linear-gradient(180deg, #1f3347 0%, #1a2d43 100%);
  color: #e6edf3;
  border: 1px solid #324761;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.story-toolbar button:hover {
  background: linear-gradient(180deg, #263d54 0%, #203651 100%);
  border-color: #3d5a7a;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.story-toolbar button:active {
  transform: translateY(0);
}

.story-toolbar button:hover {
  background: #324761;
}

.story-toolbar button:active {
  background: #1a2837;
}

/* Active state for format buttons (bold/italic) */
.story-format-btn.active {
  background: #FFD700;
  color: #0b1723;
  border-color: #FFD700;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.story-format-btn.active:hover {
  background: #FFC700;
  border-color: #FFC700;
}

.story-char-counter {
  margin-left: auto;
  font-size: 12px;
  color: #2c3e50;
  font-weight: 600;
}

/* Emoji Picker Styling */
.emoji-picker {
  position: absolute;
  background: #ffffff;
  border: 2px solid #324761;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
}

.emoji-option {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}

.emoji-option:hover {
  background: #f0f0f0;
  transform: scale(1.2);
}

.emoji-option:active {
  background: #e0e0e0;
}

/* Grid Area Assignments for Expanded Card Sections */
.directs-section {
  grid-area: directs;
  max-width: 100%;
  overflow: hidden;
}

.peers-section {
  grid-area: peers;
  max-width: 100%;
  overflow: hidden;
}

.coins-section {
  grid-area: coins;
  max-width: 100%;
  overflow: visible; /* Changed from hidden to allow tooltips to overflow */
  position: relative; /* Establish positioning context */
}

.charts-section {
  grid-area: charts;
  max-width: 100%;
  overflow: hidden;
}

/* Character counter shake animation when limit reached */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ==============================
   DELEGATION UI STYLES
   ============================== */

.delegation-info {
  display: none;
  margin-top: -2px;
  font-size: 13px;
  color: #5f748c;
  line-height: 1.3;
}

.delegation-text {
  margin-bottom: 4px;
}

.delegation-link {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
}

.delegation-link:hover {
  text-decoration: underline;
}

.delegation-manager-section {
  margin-top: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  transition: background-color 0.2s;
}

.delegation-manager-section:hover {
  background-color: rgba(0, 102, 204, 0.1);
}

/* Delegation Modal */
.modal {
  display: block;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: #1a1d24;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 1px solid #30363d;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #161b22;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #e6edf3;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #8b949e;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: #30363d;
  color: #e6edf3;
}

.modal-body {
  padding: 24px;
  background-color: #1a1d24;
  border-radius: 0 0 12px 12px;
}

.delegation-modal-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.delegation-help {
  background-color: #161b22;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #8b949e;
  border: 1px solid #30363d;
}

.delegation-add-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #30363d;
}

.delegation-add-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  color: #e6edf3;
}

.delegation-search-box {
  position: relative;
  margin-bottom: 12px;
}

.delegation-search-box input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 14px;
  background-color: #0d1117;
  color: #e6edf3;
}

.delegation-search-box input[type="text"]:focus {
  outline: none;
  border-color: #58a6ff;
  background-color: #161b22;
}

.delegation-search-box .typeahead-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #161b22;
  border: 1px solid #30363d;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.delegation-search-box .typeahead-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #30363d;
  color: #e6edf3;
}

.delegation-search-box .typeahead-item:hover {
  background-color: #21262d;
}

.delegation-search-box .typeahead-item:last-child {
  border-bottom: none;
}

.delegation-expiration {
  margin-bottom: 12px;
  font-size: 14px;
}

.delegation-expiration label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #e6edf3;
}

.delegation-expiration input[type="date"] {
  padding: 6px 10px;
  border: 1px solid #30363d;
  border-radius: 4px;
  font-size: 14px;
  background-color: #0d1117;
  color: #e6edf3;
}

.delegation-list-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  color: #e6edf3;
}

.delegation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid #30363d;
  border-radius: 6px;
  margin-bottom: 10px;
  background-color: #161b22;
}

.delegation-item-info {
  flex: 1;
  font-size: 14px;
}

.delegation-item-info strong {
  color: #e6edf3;
}

.delegation-item-info small {
  color: #8b949e;
}

.delegation-badge-ea {
  display: inline-block;
  background-color: #fbbf24;
  color: #92400e;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.delegation-badge-expired {
  display: inline-block;
  background-color: #ef4444;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.delegation-expiration-text {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8b949e;
  font-style: italic;
}

.delegation-expiration-text.expired {
  color: #f85149;
  font-weight: 600;
}

.delegation-item.expired {
  background-color: #2d1519;
  border-color: #da3633;
  opacity: 0.85;
}

.delegation-item-actions {
  display: flex;
  gap: 8px;
}

.delegation-empty {
  text-align: center;
  color: #8b949e;
  font-style: italic;
  padding: 20px;
}

.delegation-message {
  padding: 12px;
  border-radius: 6px;
  margin-top: 16px;
  font-size: 14px;
}

.delegation-message.success {
  background-color: #1c2d24;
  color: #56d364;
  border: 1px solid #2ea043;
}

.delegation-message.error {
  background-color: #2d1519;
  color: #f85149;
  border: 1px solid #da3633;
}

.delegation-message.info {
  background-color: #1c2d3a;
  color: #58a6ff;
  border: 1px solid #1f6feb;
}

/* Delegation Banner (above search results) */
.delegation-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.delegation-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.delegation-banner-icon {
  font-size: 20px;
}

.delegation-banner-filter {
  display: flex;
  align-items: center;
}

.delegation-banner-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.delegation-banner-filter input[type="checkbox"] {
  cursor: pointer;
}

/* Legacy Button styles (delegation section) - inherits from button system */
.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(180deg, #1f3347 0%, #1a2d43 100%);
  color: #e6edf3;
  border: 1px solid #324761;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-small:hover {
  background: linear-gradient(180deg, #263d54 0%, #203651 100%);
  border-color: #3d5a7a;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-small:active {
  transform: translateY(0);
}

.btn-small.btn-danger {
  background: linear-gradient(180deg, #3d1f1f 0%, #2d1515 100%);
  color: #f87171;
  border-color: #5c2828;
}

.btn-small.btn-danger:hover {
  background: linear-gradient(180deg, #4d2525 0%, #3d1f1f 100%);
  border-color: #7c3333;
  color: #fca5a5;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .delegation-banner {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .delegation-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .delegation-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===========================================
   BIRTHDAY & ANNIVERSARY CELEBRATION EFFECTS
   =========================================== */

/* Fireworks container on avatar */
.avatar-wrapper.has-fireworks {
  overflow: visible !important;
}

.fireworks-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

/* Individual firework spark */
.firework-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0;
}

/* Birthday fireworks - pink/magenta colors */
.firework-spark.birthday {
  animation: spark-burst-birthday 1.5s ease-out infinite;
}

/* Anniversary fireworks - gold colors */
.firework-spark.anniversary {
  animation: spark-burst-anniversary 1.5s ease-out infinite;
}

@keyframes spark-burst-birthday {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--spark-x), var(--spark-y)) scale(0);
    opacity: 0;
  }
}

@keyframes spark-burst-anniversary {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--spark-x), var(--spark-y)) scale(0);
    opacity: 0;
  }
}

/* Celebration container for effects */
.celebration-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* Balloon styles */
.balloon {
  position: absolute;
  width: 30px;
  height: 38px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  animation: balloon-float 8s ease-in-out infinite;
  opacity: 0.85;
}

.balloon::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 10px solid inherit;
}

.balloon::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 50%;
  width: 1px;
  height: 50px;
  background: rgba(255, 255, 255, 0.5);
}

@keyframes balloon-float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  90% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-120vh) rotate(15deg);
    opacity: 0;
  }
}

/* Confetti styles */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0.9;
}

.confetti.square {
  background: currentColor;
}

.confetti.circle {
  border-radius: 50%;
  background: currentColor;
}

.confetti.ribbon {
  width: 4px;
  height: 16px;
  background: currentColor;
  border-radius: 2px;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* Celebration badge on card */
.celebration-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 20px;
  animation: badge-bounce 1s ease-in-out infinite;
  z-index: 10;
}

@keyframes badge-bounce {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
}
