/* Fluency Coach widget — self-contained, loaded directly by index.html
   (styles.css is only used by privacy.html/terms.html, not the landing page). */

.fc-launcher {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff5a1f;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 90, 31, 0.4);
  touch-action: manipulation;
}

.fc-preview {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 72px);
  z-index: 60;
  max-width: 260px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b0b0d;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.fc-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.fc-preview-text {
  margin: 0;
  font-size: 0.875rem;
  color: #f7f5f2;
}

.fc-preview-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #a9a19c;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.fc-preview-open {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: #ff5a1f;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.fc-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  width: calc(100vw - 24px);
  max-width: 340px;
  height: min(480px, calc(100dvh - 112px));
  max-height: min(480px, calc(100dvh - 112px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #030303;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b0b0d;
}

.fc-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f7f5f2;
}

.fc-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: #a9a19c;
}

.fc-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #a9a19c;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.fc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

.fc-message {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.fc-message-user {
  align-self: flex-end;
  background: #ff5a1f;
  color: #fff;
}

.fc-message-assistant {
  align-self: flex-start;
  background: #15100d;
  color: #f7f5f2;
}

.fc-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fc-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
}

.fc-input {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 96px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b0b0d;
  color: #f7f5f2;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
}

.fc-input:focus {
  outline: 2px solid #ff5a1f;
  outline-offset: 2px;
}

.fc-send {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: none;
  background: #ff5a1f;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.fc-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fc-limit {
  padding: 12px;
  text-align: center;
  font-size: 0.875rem;
  color: #a9a19c;
}

.fc-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: #ff5a1f;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .fc-panel,
  .fc-preview {
    animation: fc-fade-in 0.2s ease-out;
  }
}

@keyframes fc-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
