:root {
  --bg-deep: #060816;
  --bg-panel: rgba(7, 10, 24, 0.72);
  --bg-panel-strong: rgba(12, 16, 34, 0.88);
  --text-strong: #f8fbff;
  --text-muted: #98a3bb;
  --color-div-8: rgba(33, 150, 243, 0.15); /* Blue Exec */
  --color-div-7: rgba(255, 112, 67, 0.15); /* Orange */
  --color-div-1: rgba(66, 165, 245, 0.15); /* Blue */
  --color-div-2: rgba(102, 187, 106, 0.15); /* Green */
  --color-div-3: rgba(255, 202, 40, 0.15); /* Yellow/Amber */
  --color-div-4: rgba(171, 71, 188, 0.15); /* Purple */
  --color-div-5: rgba(38, 198, 218, 0.15); /* Cyan */
  --color-div-6: rgba(236, 64, 122, 0.15); /* Pink */

  --border-div-8: rgba(33, 150, 243, 0.5);
  --border-div-7: rgba(255, 112, 67, 0.5);
  --border-div-1: rgba(66, 165, 245, 0.5);
  --border-div-2: rgba(102, 187, 106, 0.5);
  --border-div-3: rgba(255, 202, 40, 0.5);
  --border-div-4: rgba(171, 71, 188, 0.5);
  --border-div-5: rgba(38, 198, 218, 0.5);
  --border-div-6: rgba(236, 64, 122, 0.5);

  --text-div-8: #90caf9;
  --text-div-7: #ffab91;
  --text-div-1: #90caf9;
  --text-div-2: #a5d6a7;
  --text-div-3: #ffe082;
  --text-div-4: #ce93d8;
  --text-div-5: #80deea;
  --text-div-6: #f48fb1;

  --dash-accent: rgba(33, 150, 243, 0.5);
  --dash-accent-faded: rgba(33, 150, 243, 0.1);
  --scroll-track: rgba(10, 14, 28, 0.78);
  --scroll-thumb: linear-gradient(180deg, rgba(99, 102, 241, 0.78), rgba(56, 189, 248, 0.72));
  --scroll-thumb-hover: linear-gradient(180deg, rgba(129, 140, 248, 0.92), rgba(45, 212, 191, 0.88));
}

html {
  overflow-x: hidden;
  background: #04060d;
}

html,
body {
  min-height: 100%;
  overflow-y: auto;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 126, 255, 0.7) rgba(9, 12, 24, 0.55);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid rgba(4, 8, 18, 0.7);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.14), transparent 22%),
    radial-gradient(circle at bottom center, rgba(20, 184, 166, 0.1), transparent 26%),
    linear-gradient(180deg, #070915 0%, #04060d 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 86%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
}

/* Ambient Animated Orbs */
.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.2;
  pointer-events: none;
  animation: float 20s infinite ease-in-out alternate;
}

.orb-1 { width: 500px; height: 500px; background: #6b21a8; top: -100px; left: -100px; }
.orb-2 { width: 400px; height: 400px; background: #1d4ed8; bottom: -100px; right: -50px; animation-delay: -5s; }
.orb-3 { width: 600px; height: 600px; background: #0f766e; top: 30%; left: 30%; animation-delay: -10s; opacity: 0.1; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.9); }
}

.glass-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    var(--glass, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glassBorder, rgba(255, 255, 255, 0.06));
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.top-dock {
  padding: 0.35rem;
  border-radius: 1.35rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  background: linear-gradient(180deg, rgba(14, 18, 32, 0.92), rgba(8, 10, 18, 0.78));
  border: 1px solid rgba(255,255,255,0.08);
  border-right: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: min(22rem, calc(100vw - 1rem));
}

.top-dock-wrap {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0;
  right: 0 !important;
  pointer-events: none;
}

.top-dock-wrap > * {
  pointer-events: auto;
}

.top-dock-handle {
  width: 0.9rem;
  height: 4rem;
  border-radius: 0 0.7rem 0.7rem 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 0;
  color: rgba(255,255,255,0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.24);
}

.top-dock-handle i {
  font-size: 0.62rem;
  transition: transform 0.3s ease;
}

body.dock-collapsed .top-dock {
  transform: translateX(calc(100% + 0.5rem));
  opacity: 0;
  pointer-events: none;
}

body.dock-collapsed .top-dock-handle i {
  transform: rotate(180deg);
}

.app-briefing {
  min-height: 68px;
  background:
    radial-gradient(circle at top left, rgba(99,102,241,0.18), transparent 30%),
    linear-gradient(90deg, rgba(12, 16, 31, 0.96), rgba(10, 13, 24, 0.88));
}

.daily-brief-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-right: 23rem;
}

.brief-reopen-btn {
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.brief-reopen-btn:hover {
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.22);
  color: white;
}

.daily-brief-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.daily-brief-copy {
  flex-shrink: 0;
}

.daily-brief-priorities {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.daily-brief-chip,
.daily-brief-focus {
  min-width: 0;
  white-space: normal;
  word-break: normal;
}

.daily-brief-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.daily-brief-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
}

.executive-stage {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
  gap: 2rem;
  align-items: center;
}

.executive-copy {
  max-width: 40rem;
}

.executive-label {
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.executive-title {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-strong);
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
}

.executive-subtitle {
  color: var(--text-muted);
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.65;
}

.executive-card {
  justify-self: end;
}

.board-shell {
  position: relative;
  padding: 1rem 0 0;
}

.board-shell::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 20rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(59,130,246,0.08), transparent 22%),
    radial-gradient(circle at 80% 10%, rgba(139,92,246,0.08), transparent 24%);
  pointer-events: none;
}

.hierarchy-node {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.division-col {
  width: 85vw;
  min-width: 300px;
  max-width: 340px;
  height: calc(100vh - 280px);
  min-height: 500px;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  position: relative;
  border-top-width: 4px;
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

main.custom-scrollbar,
main.custom-scrollbar::-webkit-scrollbar {
  height: 12px;
}

.division-col:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.58);
  transform: translateY(-8px);
}

.kanban-list {
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 50px;
  padding: 0.5rem;
  padding-right: 0.35rem;
}

.kanban-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(8, 11, 22, 0.74);
  border-radius: 999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.74), rgba(56, 189, 248, 0.68));
  border-radius: 999px;
  border: 2px solid rgba(4, 8, 18, 0.68);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.92), rgba(45, 212, 191, 0.88));
}

.kanban-card {
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.92), rgba(12, 13, 19, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  cursor: grab;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

.kanban-card:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.kanban-card:hover {
  background: linear-gradient(180deg, rgba(30, 30, 35, 0.95), rgba(17, 18, 24, 0.92));
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px var(--card-accent);
  transform: translateY(-3px);
}

.kanban-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-accent, rgba(255, 255, 255, 0.3));
  border-radius: 4px 0 0 4px;
}

.division-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.division-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.division-kicker {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.42);
  font-weight: 700;
}

.division-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.division-stat {
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 0.68rem;
  color: #c4cce0;
}

.division-tool {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.card-progress {
  font-size: 0.7rem;
  color: #d6dcf0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.card-action-primary,
.card-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.95rem;
  min-height: 2.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.card-action-primary {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #dbe4ff;
}

.card-action-primary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.14);
}

.card-action-secondary {
  padding: 0 1rem;
  color: #f5d0fe;
  background: linear-gradient(135deg, rgba(147,51,234,0.2), rgba(79,70,229,0.22));
  border: 1px solid rgba(168,85,247,0.32);
  box-shadow: 0 0 24px rgba(147,51,234,0.14);
}

.card-action-secondary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.empty-column-state {
  min-height: 10rem;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  background: rgba(255,255,255,0.02);
}

#memoryLogContainer::-webkit-scrollbar,
#agentLogContainer::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#memoryLogContainer,
#agentLogContainer {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.memory-row {
  position: relative;
  padding-right: 3rem;
}

.memory-delete-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: rgba(248,113,113,0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.memory-delete-btn:hover {
  color: #fecaca;
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.22);
}

.sortable-ghost {
  opacity: 0.3;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  transform: scale(0.98);
}

.sortable-drag {
  cursor: grabbing !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  opacity: 1 !important;
  transform: rotate(2deg) scale(1.02);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  color: #ccc;
}

.todo-item.done {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.3);
}

.todo-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.todo-checkbox:checked {
  background: var(--card-accent, #4caf50);
  border-color: var(--card-accent, #4caf50);
}

.todo-checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: #111;
  font-size: 12px;
  font-weight: bold;
  left: 2px;
  top: -1px;
}

.todo-list-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.todo-list-container.expanded {
  max-height: 600px;
  transition: max-height 0.6s ease-in-out;
}

.edit-item-btn {
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
  background: rgba(0,0,0,0.5);
  border-radius: 8px;
  padding: 6px;
}
.kanban-card:hover .edit-item-btn {
  opacity: 1;
}

.vfp-input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(255,255,255,0.8);
  width: 100%;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  font-style: italic;
}

.vfp-input:focus {
  outline: none;
  border-bottom-color: var(--card-accent, rgba(255, 255, 255, 0.8));
  color: white;
}

.dash-nav-btn.active {
  background: rgba(255,255,255,0.1);
  color: white;
  box-shadow: inset 2px 0 0 0 var(--dash-accent);
}

#dailyBriefingPanel {
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.92), rgba(13, 18, 34, 0.88));
  border-bottom-color: rgba(255,255,255,0.08);
}

#board {
  padding-bottom: 1rem;
}

#dashboardModal {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(139,92,246,0.12), transparent 28%),
    linear-gradient(180deg, #060816 0%, #05070f 100%);
}

#onboardingModal {
  align-items: flex-start;
  justify-content: center;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#onboardingLogoutBtn {
  position: relative;
  z-index: 1;
}

#settingsModal {
  align-items: flex-start;
  justify-content: center;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.onboarding-stage {
  align-items: flex-start;
  padding-top: 4.5rem;
  padding-bottom: 2rem;
  min-height: max(100dvh, 100%);
}

.settings-modal-panel {
  margin-top: 4.5rem;
  margin-bottom: 2rem;
}

#onboardingModal .glass-panel {
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .top-dock {
    max-width: min(14rem, calc(100vw - 0.85rem));
  }

  .daily-brief-panel {
    flex-direction: column;
    align-items: stretch !important;
    margin-right: 4.35rem !important;
  }

  .daily-brief-chip,
  .daily-brief-focus {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .app-briefing {
    min-height: auto;
  }

  .daily-brief-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-brief-copy,
  .daily-brief-priorities,
  .daily-brief-actions {
    width: 100%;
  }

  .daily-brief-actions {
    justify-content: flex-end;
  }

  .executive-stage {
    grid-template-columns: 1fr;
  }

  .onboarding-stage {
    padding-top: 3.5rem;
    padding-bottom: 1.5rem;
  }

  .settings-modal-panel {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
  }

  .executive-card {
    justify-self: stretch;
    max-width: none;
  }

  .app-briefing {
    margin-right: 4.35rem !important;
  }

  .top-dock-wrap {
    right: 0 !important;
  }

  .dashboard-sidebar {
    width: 4.75rem !important;
  }

  .dashboard-sidebar nav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .dash-nav-btn {
    justify-content: center;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .dashboard-main .dash-view {
    padding: 1rem !important;
  }

  #dashboardModal {
    align-items: stretch;
  }

  .dashboard-main {
    min-width: 0;
  }

  #dashboardKanbanContainer,
  #battlePlanGrid,
  #trainingContent {
    max-width: 100%;
  }

  #battlePlanGrid {
    grid-template-columns: 1fr !important;
  }

  #dashboardMetricsView .glass-panel,
  #dashboardAgentsView .glass-panel,
  #dashboardTrainingView .glass-panel,
  #dashboardBattlePlanView .glass-panel {
    border-radius: 1.2rem;
  }

  #dashboardMetricsView canvas {
    max-width: 100%;
  }

  .metrics-input-bar,
  .memory-search-row {
    width: 100%;
  }

  #metricInputContainer {
    width: 100%;
  }

  #metricInputContainer > * {
    width: 100%;
  }

  .metric-field {
    width: 100%;
  }

  .metric-save-row {
    width: 100%;
  }

  #metricDateInput {
    width: 100%;
  }

  #dashboardMetricsView .metrics-toolbar h3,
  #dashboardBattlePlanView h3,
  #dashboardAgentsView h3,
  #dashboardTrainingView h3 {
    font-size: 1.85rem;
    line-height: 1.05;
  }

  #dashboardMetricsView .glass-panel,
  #dashboardAgentsView .glass-panel {
    padding: 1rem;
  }

  #dashboardMetricsView .chart-period-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  #dashboardMetricsView .ml-auto {
    margin-left: 0 !important;
    width: 100%;
    justify-content: flex-end;
  }

  #agentLogContainer,
  #memoryLogContainer {
    max-height: 18rem !important;
  }

  #awakenAgentsBtn {
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
  }

  #dashboardAgentsView .grid {
    grid-template-columns: 1fr !important;
  }

  .division-col {
    min-width: 288px;
    max-width: 312px;
    margin: 0.25rem;
  }

  #board {
    gap: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* AI Chat Message Animation */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message {
  animation: slideUp 0.3s ease-out forwards;
}

/* AI Loading Dots */
.typing-dot {
  animation: typing 1.4s infinite ease-in-out;
  fill: currentColor;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Tooltip Base */
.info-tooltip {
  cursor: help;
}

.app-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  max-width: min(18rem, calc(100vw - 1rem));
  background: rgba(10, 10, 15, 0.96);
  color: white;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: 0.8rem;
  font-size: 0.75rem;
  line-height: 1.45;
  box-shadow: 0 16px 35px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 140;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.app-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Battle Plan Specifics */
.bp-checkbox {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  position: relative;
}
.bp-checkbox:checked {
  background: var(--dash-accent);
  border-color: var(--dash-accent);
}
.bp-checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 10px;
  left: 3px;
  top: 0;
}

/* Training formatter */
.format-training h3 { font-size: 1.2rem; font-weight: 700; color: white; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.format-training p { margin-bottom: 1rem; }
.format-training b { color: var(--dash-accent); }

.skill-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.75rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.skill-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 88px;
  padding: 0.9rem 0.7rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #d1d5db;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.skill-icon-option:hover {
  transform: translateY(-1px);
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16,185,129,0.08);
  color: white;
}

.skill-icon-option i {
  font-size: 1.15rem;
}

.skill-icon-option span {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.skill-color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.skill-color-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.skill-color-option:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.ai-conversation-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ai-conversation-tab.active {
  background: rgba(99,102,241,0.16);
  border-color: rgba(129,140,248,0.32);
  color: white;
}

.ai-conversation-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.68rem;
}

.ai-conversation-delete {
  opacity: 0.55;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.ai-conversation-delete:hover {
  opacity: 1;
  color: #fca5a5;
}

@media (max-width: 980px) {
  .skill-icon-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 18rem;
  }

  .skill-color-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
