:root {
  --navy: #1e3a8a;
  --navy-dark: #0f172a;
  --lightblue: #0ea5e9;
  --gold: #eab308;
  --bg-gray: #f1f5f9;
  --text-main: #1f2937;
  --text-muted: #64748b;
  --compass-bg: #ffffff;
  --compass-border: #e2e8f0;
  --card-bg: #f0f9ff;
  --btn-bg: #ffffff;
  --btn-hover: #f8fafc;
}

#choate-ai-compass-widget,
#choate-ai-compass-widget * {
  box-sizing: border-box;
}

#choate-ai-compass-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  left: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  pointer-events: none;
}

#choate-ai-compass-widget .launcher-btn,
#choate-ai-compass-widget .compass-case.active {
  pointer-events: auto;
}

#choate-ai-compass-widget .launcher-btn {
  width: 65px;
  height: 65px;
  background: #1e3a8a;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

#choate-ai-compass-widget .launcher-btn:hover {
  transform: scale(1.1);
}

#choate-ai-compass-widget .launcher-icon {
  font-size: 32px;
  color: white;
}

#choate-ai-compass-widget .launcher-label {
  position: absolute;
  right: 80px;
  left: auto;
  background: #1f2937;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#choate-ai-compass-widget .launcher-btn:hover .launcher-label {
  opacity: 1;
}

#choate-ai-compass-widget .compass-case {
  background: #1e3a8a;
  width: 400px;
  max-width: 90vw;
  padding: 12px;
  border-radius: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: absolute;
  bottom: 80px;
  right: 0;
  left: auto;
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  visibility: hidden;
}

#choate-ai-compass-widget .compass-case.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
}

#choate-ai-compass-widget .close-btn {
  position: absolute;
  top: -15px;
  right: -5px;
  background: var(--compass-bg);
  color: var(--navy);
  border: 2px solid #1e3a8a;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#choate-ai-compass-widget .compass-ring {
  background: var(--compass-bg);
  border-radius: 24px;
  padding: 5px;
  position: relative;
  border: 4px solid var(--gold);
  height: 100%;
  transition: border-color 0.4s ease, background 0.3s;
}

#choate-ai-compass-widget .compass-face {
  background: var(--compass-bg);
  border-radius: 18px;
  padding: 20px;
  min-height: 400px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.3s;
  color: var(--text-main);
}

#choate-ai-compass-widget .compass-face::-webkit-scrollbar {
  width: 6px;
}

#choate-ai-compass-widget .compass-face::-webkit-scrollbar-thumb {
  background-color: var(--compass-border);
  border-radius: 3px;
}

#choate-ai-compass-widget .compass-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--compass-border);
  padding-bottom: 15px;
}

#choate-ai-compass-widget .needle-container {
  width: 50px;
  height: 50px;
  border: 3px solid var(--lightblue);
  border-radius: 50%;
  position: relative;
  margin-bottom: 8px;
  background: var(--card-bg);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#choate-ai-compass-widget .needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 38px;
  background: linear-gradient(to bottom, #ef4444 50%, var(--navy) 50%);
  transform: translate(-50%, -50%) rotate(-45deg);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

#choate-ai-compass-widget .needle-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

#choate-ai-compass-widget .title {
  color: var(--navy);
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

#choate-ai-compass-widget .subtitle {
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  margin: 5px 0 0 0;
  font-weight: normal;
  line-height: 1.3;
  max-width: 95%;
}

#choate-ai-compass-widget .progress-wrapper {
  width: 100%;
  height: 6px;
  background: var(--compass-border);
  border-radius: 3px;
  margin-top: 15px;
  overflow: hidden;
}

#choate-ai-compass-widget .progress-fill {
  height: 100%;
  background: var(--lightblue);
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#choate-ai-compass-widget .compass-content {
  width: 100%;
  animation: compassFadeIn 0.4s ease-out;
}

@keyframes compassFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

#choate-ai-compass-widget .question {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--navy-dark);
  line-height: 1.4;
}

#choate-ai-compass-widget .description {
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  line-height: 1.5;
  border: 1px dashed var(--lightblue);
}

#choate-ai-compass-widget .options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#choate-ai-compass-widget .btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  background: var(--btn-bg);
  color: var(--navy);
  border: 2px solid var(--compass-border);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s;
}

#choate-ai-compass-widget .btn:hover {
  border-color: var(--navy);
  background: var(--btn-hover);
  transform: translateX(4px);
}

#choate-ai-compass-widget .btn span:last-child {
  color: var(--gold);
  font-weight: 900;
}

#choate-ai-compass-widget .btn-primary {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
  justify-content: center;
  font-size: 1.05rem;
  padding: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#choate-ai-compass-widget .btn-primary:hover {
  background: #1e40af;
  transform: translateY(-2px);
  border-color: var(--lightblue);
}

#choate-ai-compass-widget .btn-primary span:last-child,
#choate-ai-compass-widget .btn-secondary-ai span:last-child,
#choate-ai-compass-widget .btn-receipt span:last-child {
  display: none;
}

#choate-ai-compass-widget .btn-secondary-ai {
  background: transparent;
  border: 2px dashed var(--lightblue);
  color: var(--navy);
  justify-content: center;
  font-weight: normal;
}

#choate-ai-compass-widget .btn-secondary-ai:hover {
  background: var(--card-bg);
  border-style: solid;
  transform: translateY(-2px);
}

#choate-ai-compass-widget .btn-maybe {
  background: var(--btn-hover);
  border-style: dashed;
  color: var(--text-muted);
}

#choate-ai-compass-widget .btn-maybe:hover {
  border-color: var(--lightblue);
  color: var(--navy);
}

#choate-ai-compass-widget .btn-ai-eval {
  background: var(--card-bg);
  border-color: var(--lightblue);
  color: var(--navy);
  justify-content: center;
  margin-top: 10px;
}

#choate-ai-compass-widget .btn-receipt {
  background: #10b981;
  color: white;
  border-color: #059669;
  justify-content: center;
  margin-bottom: 10px;
}

#choate-ai-compass-widget .btn-receipt:hover {
  background: #059669;
  transform: translateY(-2px);
}

#choate-ai-compass-widget .persistent-ai-btn {
  background: var(--card-bg);
  color: var(--navy);
  border: 1px solid var(--lightblue);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  margin-top: 25px;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#choate-ai-compass-widget .persistent-ai-btn:hover {
  background: var(--lightblue);
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

#choate-ai-compass-widget .btn-reset {
  background: transparent;
  color: var(--text-muted);
  border: none;
  margin-top: 10px;
  width: 100%;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s;
}

#choate-ai-compass-widget .btn-reset:hover {
  text-decoration: underline;
  color: var(--navy);
}

#choate-ai-compass-widget .btn-back {
  margin-top: 10px;
  color: var(--navy);
  font-weight: 600;
}

#choate-ai-compass-widget .status-pass .compass-ring { border-color: #22c55e; }
#choate-ai-compass-widget .status-pass .needle { background: #22c55e; }
#choate-ai-compass-widget .status-stop .compass-ring { border-color: #ef4444; }
#choate-ai-compass-widget .status-stop .needle { background: #ef4444; }
#choate-ai-compass-widget .status-pause .compass-ring { border-color: var(--gold); }
#choate-ai-compass-widget .status-pause .needle { background: var(--gold); }
#choate-ai-compass-widget .status-guide .compass-ring { border-color: var(--lightblue); }
#choate-ai-compass-widget .status-guide .needle { background: var(--lightblue); }

#choate-ai-compass-widget .loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(14, 165, 233, 0.3);
  border-radius: 50%;
  border-top-color: var(--lightblue);
  animation: compassSpin 1s linear infinite;
  margin: 10px auto;
}

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