/* style.css */
@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-one@latest/latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-one@latest/latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-one@latest/latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sauce";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-one@latest/latin-700-normal.woff2") format("woff2");
}

:root {
  --primary: #0F5464;
  --primary-hover: #5CC9CC;
  --secondary: #5CC9CC;
  --bg-color: #F3FBFB;
  --chat-bg: #ffffff;
  --text-main: #111111;
  --text-muted: #5B6870;
  --border-color: #d8eeee;
  --msg-user-bg: #0F5464;
  --msg-user-text: #ffffff;
  --msg-bot-bg: #ffffff;
  --msg-bot-text: #111111;
  --font-logo: "VG Rounded", "Arial Rounded MT Bold", "Helvetica Rounded", Helvetica, Arial, sans-serif;
  --font-heading: Helvetica, Arial, sans-serif;
  --font-body: "Open Sauce", "Open Sauce One", "Open Sauce Sans", Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 20px 54px rgb(15 84 100 / 0.10), 0 2px 10px rgb(15 84 100 / 0.05);
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --app-height: 100vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-appearance: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: var(--app-height);
  margin: 0;
  overflow-y: auto;
  padding: max(25px, var(--safe-top)) 0 max(20px, var(--safe-bottom));
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 1080px;
  height: auto;
  min-height: var(--app-height);
  margin: 0 auto;
  background: var(--chat-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: visible; /* Changed from hidden to allow page scrolling */
  border: 1px solid var(--border-color);
}

html,
body {
  max-width: 100%;
}

.app-splash {
  position: fixed;
  inset: 0;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-card {
  width: min(78vw, 300px);
  padding: 24px 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 84, 100, 0.14);
  box-shadow: 0 14px 32px rgba(15, 84, 100, 0.1);
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-splash-title {
  font-family: var(--font-logo);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.app-splash-subtitle {
  margin-top: 6px;
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
  color: var(--text-muted);
}

.chat-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: #eefafa;
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  position: relative;
}

.banner-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.banner-img {
  width: 100%;
  height: clamp(160px, 30vw, 310px);
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.banner-img:active {
  transform: scale(0.995);
}

.info-body {
  background: white;
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow-y: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  font-size: 2rem;
}

.brand-text h1 {
  font-family: var(--font-logo);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-text .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--primary);
  /* Official teal applied to reset button */
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--bg-color);
  color: var(--primary-hover);
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.messages-area {
  flex: none; /* Growth as needed */
  padding: 24px 24px 96px 24px;
  overflow-y: visible; /* Prevent internal scrolling */
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  justify-content: flex-start;
  padding-top: 25px;
  scrollbar-width: none;
}

.messages-area.choice-mode {
  padding-bottom: 112px;
}

.messages-area:has(.welcome-message) {
  padding-bottom: 32px;
}

/* Welcome Message Special Styling */
.welcome-message {
  width: 100%;
  max-width: 100% !important;
  align-self: center !important;
  text-align: center;
  margin-top: 15px; /* Compacted whitespace */
  margin-bottom: 15px;
}

.welcome-message .msg-bubble {
  background: white !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  padding: clamp(28px, 5vw, 48px) !important;
  border-radius: 8px !important;
  max-width: 840px;
  margin: 0 auto;
  box-shadow: 0 18px 44px rgba(15, 84, 100, 0.08) !important;
}

.welcome-title {
  display: block;
  max-width: 800px;
  margin: 0 auto 24px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
}

.welcome-subtitle {
  max-width: 680px;
  margin: 0 auto 28px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
}

.welcome-title {
  font-size: 1.2rem;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-style: normal;
  color: var(--text-main);
}

.welcome-disclaimer {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  display: block;
  margin-top: 10px;
}

.welcome-message .msg-time {
  display: none;
}

/* Chrome, Safari, Opera */
.messages-area::-webkit-scrollbar {
  display: none;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 95%;
  animation: fadeIn 0.3s ease-in-out;
  min-width: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.msg-bubble *,
.info-body *,
.modal-content * {
  max-width: 100%;
}

.message.user-msg {
  align-self: flex-end;
}

.message.user-msg .msg-bubble {
  background: var(--msg-user-bg);
  color: var(--msg-user-text);
  border-bottom-right-radius: 4px;
}

.message.system-msg {
  align-self: flex-start;
}

.message.system-msg .msg-bubble {
  background: var(--msg-bot-bg);
  color: var(--msg-bot-text);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.message.system-msg.danger .msg-bubble {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
  font-weight: 500;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.message.user-msg .msg-time {
  align-self: flex-end;
}

.message.system-msg .msg-time {
  align-self: flex-start;
}

.messages-area.choice-mode .message:last-child {
  margin-bottom: 18px;
}

.result-start {
  scroll-margin-top: 16px;
}

/* ID Copy Box Container */
.id-copy-box {
  background: var(--primary);
  color: white;
  padding: 15px;
  border-radius: 12px;
  margin: 20px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  user-select: none;
}

.id-copy-box:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.3);
}

.id-copy-box .id-number {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  margin: 10px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.id-copy-box .copy-hint {
  margin: 8px 0 0 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

.id-copy-box:active {
  transform: scale(0.98);
}

.registration-gate {
  background: #f8fbfb;
  border: 1px solid rgba(92, 201, 204, 0.24);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  color: var(--text-main);
}

.registration-gate p {
  margin-bottom: 10px;
}

.registration-field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.registration-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font: inherit;
}

.recovery-prefix-row {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.recovery-prefix-input {
  width: 96px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.registration-note,
.ai-final-notice {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-style: italic;
}

.chat-footer-links {
  background: white;
  padding: 8px 16px 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.chat-footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin: 0 2px;
}

.chat-footer-links a:hover {
  text-decoration: underline;
}

.chat-input-area {
  padding: 16px 24px;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.02); /* Sottile ombra per staccare dal thread messaggi */
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.chat-input-area.choice-hidden {
  display: none !important;
}

.chat-input-area.onboarding-hidden {
  display: none !important;
}

.chat-input-area textarea {
  flex: 1;
  resize: none;
  overflow-y: hidden;
  padding: 14px 22px; /* Spazio interno più ampio per individuabilità */
  border-radius: 8px;
  border: 2px solid #e0e9e9; /* Bordo più deciso rispetto al precedente */
  background: #fbfcfc; /* Leggerissimo stacco cromatico */
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  max-height: 120px;
  min-height: 52px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); /* Profondità costante */
}

.chat-input-area textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 4px 12px rgba(92, 201, 204, 0.2); /* Focus molto più marcato */
}

.chat-input-area textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-input-area textarea::-webkit-scrollbar {
  display: none;
}

.btn-primary {
  background-color: var(--secondary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.btn-primary:hover {
  background-color: var(--primary);
}

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

.btn-primary:disabled {
  background-color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* Typing Indicator */
.typing-indicator {
  position: absolute;
  bottom: calc(84px + var(--safe-bottom));
  left: 24px;
  background: var(--msg-bot-bg);
  padding: 8px 16px;
  border-radius: 16px;
  display: flex;
  gap: 4px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.3s;
}

.typing-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.quick-replies {
  display: none;
  gap: 10px;
  justify-content: center;
  padding: 10px 16px;
  background: white;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: calc(90px + var(--safe-bottom));
  z-index: 19;
  box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.03);
}

.quick-replies.hidden {
  display: none !important;
}

.quick-reply-btn {
  flex: 1;
  max-width: 260px;
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(92, 201, 204, 0.26);
  border-radius: 12px;
  background: rgba(92, 201, 204, 0.1);
  color: var(--primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  line-height: 1.25;
  padding: 9px 12px;
}

.quick-choice-letter {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.quick-choice-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mcq-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(92, 201, 204, 0.14);
  border-radius: 10px;
  background: #f7fbfb;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}

.mcq-option:hover,
.mcq-option:focus-visible {
  background: rgba(92, 201, 204, 0.1);
  border-color: rgba(92, 201, 204, 0.32);
  outline: none;
}

.mcq-option:active {
  transform: scale(0.99);
}

.mcq-options.is-locked .mcq-option {
  cursor: default;
  pointer-events: none;
}

.mcq-option.is-disabled {
  opacity: 0.52;
}

.mcq-option.is-selected {
  opacity: 1;
  background: rgba(92, 201, 204, 0.14);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(92, 201, 204, 0.08);
}

.quick-reply-btn:disabled {
  opacity: 0.52;
  cursor: default;
}

.mcq-letter {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(92, 201, 204, 0.13);
  color: var(--primary);
  font-weight: 800;
}

.mcq-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

#ai-loading-box {
  scroll-margin-bottom: calc(96px + var(--safe-bottom));
}

#ai-loading-box p {
  text-align: center;
}

.quick-reply-btn:active {
  transform: scale(0.96);
  background: rgba(92, 201, 204, 0.18);
}

@media (min-width: 951px) {
  .quick-replies.desktop-choice-mode {
    display: none !important;
  }
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Risultati Triage */
.triage-result {
  margin-top: 12px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.triage-result-header {
  background: var(--bg-color);
  padding: 8px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.triage-result-body {
  padding: 12px;
  font-size: 0.85rem;
}

.triage-result-body p {
  margin-bottom: 4px;
}

.triage-result-body strong {
  color: var(--primary);
}

.tag-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: white;
}

/* Privacy Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(39, 59, 74, 0.7);
  /* Slate with opacity */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  z-index: 9999;
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease;
}

#legal-modal {
  z-index: 10001;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: white;
  padding: 22px 28px;
  border-radius: 16px;
  width: min(94vw, 660px);
  max-height: calc(var(--app-height) - 24px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content h3 {
  color: var(--primary);
  margin: 0;
  font-size: 1.3rem;
}

.modal-scroll {
  max-height: none;
  overflow-y: auto;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.36;
  color: var(--text-muted);
  background: var(--bg-color);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);

  /* Nasconde la scrollbar pur permettendo lo scroll nativo del testo in eccesso */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-scroll::-webkit-scrollbar {
  display: none;
}

.modal-scroll p {
  margin-bottom: 8px;
}

.modal-scroll strong {
  color: var(--text-main);
}

.inline-legal-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-legal-link:hover {
  color: var(--primary-hover);
}

.inline-page-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-page-link:hover {
  color: var(--primary-hover);
}

.age-gate {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.age-gate label,
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 7px 0;
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.3;
}

.age-gate input,
.consent-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.minor-flow-message {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
}

.minor-flow-message.hidden {
  display: none;
}

#privacy-modal .modal-scroll {
  overflow: visible;
}

.btn-primary-wide {
  background-color: var(--secondary);
  color: white;
  border: none;
  border-radius: 8px;
  min-height: 52px;
  height: auto;
  font-family: var(--font-heading);
  font-size: clamp(1.0625rem, 1.6vw, 1.125rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary-wide:hover {
  background-color: var(--primary);
}

.btn-primary-wide:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary-wide:active {
  transform: scale(0.98);
}

.medical-disclaimer-card {
  margin: 0 auto 24px;
  padding: clamp(16px, 2.4vw, 22px);
  border: 1px solid rgba(15, 84, 100, 0.18);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f3fbfb;
  color: var(--text-main);
  text-align: left;
}

.medical-disclaimer-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-weight: 700;
  line-height: 1.2;
}

.medical-disclaimer-card p {
  margin: 0 0 8px !important;
  color: var(--text-main) !important;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.45vw, 1rem) !important;
  font-weight: 400;
  line-height: 1.6;
  text-align: left !important;
}

.medical-disclaimer-card p:last-child {
  margin-bottom: 0 !important;
}

.initial-intake-card {
  margin: 0 auto;
  padding: clamp(22px, 3.2vw, 34px);
  border: 1px solid rgba(15, 84, 100, 0.18);
  border-radius: 8px;
  background: var(--bg-color);
  box-shadow: 0 18px 46px rgba(15, 84, 100, 0.08);
  text-align: left;
}

.initial-intake-card.completed {
  display: none;
}

.initial-intake-card h3 {
  margin: 0 0 8px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.initial-intake-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
  line-height: 1.6;
}

.initial-field {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.initial-field span,
.initial-fieldset legend {
  color: var(--primary);
  font-size: clamp(0.875rem, 1.4vw, 0.9375rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.initial-field input[type="number"] {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--text-main);
  font: inherit;
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
}

.initial-field input[type="number"]:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(92, 201, 204, 0.18);
  outline: none;
}

.initial-fieldset {
  margin: 14px 0 8px;
  padding: 0;
  border: 0;
}

.initial-fieldset p {
  margin: 6px 0 10px;
}

.age-range-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.sex-at-birth-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.age-range-card,
.sex-at-birth-card {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: clamp(0.9375rem, 1.4vw, 1rem);
  font-weight: 600;
  line-height: 1.4;
}

.age-range-card:has(input:checked),
.sex-at-birth-card:has(input:checked) {
  border-color: var(--secondary);
  background: #eefafa;
  box-shadow: 0 0 0 2px rgba(92, 201, 204, 0.18);
}

.age-range-card:focus-within,
.sex-at-birth-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 201, 204, 0.22);
}

.age-range-card input,
.sex-at-birth-card input {
  accent-color: var(--secondary);
  flex: 0 0 auto;
}

.initial-error {
  min-height: 18px;
  margin: 4px 0 0 !important;
  color: var(--danger) !important;
  font-size: 0.82rem !important;
  font-weight: 700;
}

/* --- Novità UI --- */
.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(243, 251, 251, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  border-top: 1px solid rgba(15, 84, 100, 0.08);
  z-index: 5;
}

.recovery-nav-group {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: 8px;
  border-left: 1px solid var(--border-color);
  padding-left: 12px;
}

#recovery-id-input {
  width: 112px;
  min-width: 112px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  text-align: left;
  background: var(--bg-color);
  color: var(--text-main);
}

#recovery-id-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.recovery-btn-style {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  font-family: var(--font-heading);
  font-size: clamp(0.74rem, 1.5vw, 1rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--primary);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: white;
  color: var(--secondary);
  border-color: var(--secondary);
}

.nav-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.content-container {
  flex: none; /* Changed from 1 to allow natural growth */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible; /* Changed from hidden */
  min-height: 0;
}

.tab-content {
  min-width: 0;
}

.hidden-section {
  display: none !important;
}

.info-section {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: white;
  -webkit-overflow-scrolling: touch;
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

.info-body {
  max-width: 650px;
  margin: 0 auto;
}

.info-body h2 {
  color: var(--primary);
  margin-bottom: 20px;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4.2vw, 2.625rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-align: center;
}

.info-body > h3 {
  color: var(--primary);
  margin: 24px 0 12px;
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.info-body p {
  margin-bottom: 16px;
  color: var(--text-main);
  font-size: clamp(1rem, 1.7vw, 1.125rem);
  line-height: 1.7;
}

.section-image {
  max-width: 100%;
  height: auto;
  max-height: 220px;
  margin: 0 auto 24px;
  display: block;
  border-radius: 12px;
  object-fit: contain;
}

/* Branding & Positioning UI */
.brand-positioning {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}

.problem-box, .solution-box {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.problem-box {
  background-color: #fff5f5;
  border-left: 5px solid var(--danger);
}

.solution-box {
  background-color: #f0fdfd;
  border-left: 5px solid var(--primary);
}

.problem-box h3, .solution-box h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.problem-box h3 { color: #b91c1c; }
.solution-box h3 { color: var(--primary); }

.impact-stats {
  background: var(--primary);
  color: white;
  padding: 24px;
  border-radius: 18px;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(92, 201, 204, 0.2);
  margin-top: 10px;
  font-size: 1.05rem;
  line-height: 1.4;
}

.plus-showcase {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid rgba(92, 201, 204, 0.2);
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  background: #f8fbfb;
  box-shadow: var(--shadow-sm);
}

.plus-showcase h3 {
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.plus-showcase p {
  margin-bottom: 0;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 28px 0 8px;
}

.showcase-card {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fbfb;
  box-shadow: var(--shadow-sm);
}

.showcase-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--text-main);
}

.showcase-card ul {
  margin: 0;
  padding-left: 18px;
}

.showcase-card li {
  margin-bottom: 8px;
  color: var(--text-main);
  line-height: 1.4;
  font-size: 0.92rem;
}

.showcase-card li:last-child {
  margin-bottom: 0;
}

.showcase-bronze {
  border-top: 5px solid #a97142;
}

.showcase-silver {
  border-top: 5px solid #8b9aaa;
}

.showcase-gold {
  border-top: 5px solid #c69225;
}

.showcase-gold-plus {
  border-top: 5px solid var(--primary);
}

.cta-container {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.btn-premium-wide {
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-family: var(--font-heading);
  font-size: clamp(1.0625rem, 1.6vw, 1.125rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 22px rgba(92, 201, 204, 0.28);
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}

.btn-premium-wide:hover {
  transform: translateY(-3px);
  background: var(--primary);
  box-shadow: 0 8px 25px rgba(15, 84, 100, 0.24);
}

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

.btn-secondary-wide {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 12px 24px;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.4vw, 1.0625rem);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  width: 100%;
  max-width: 400px;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
}

.btn-secondary-wide:hover {
  background: var(--bg-color);
}

/* Glossary */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 15px;
}

.g-card {
  background: var(--bg-color);
  padding: 20px 22px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: clamp(0.9375rem, 1.2vw, 1rem);
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
  min-height: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.g-card strong {
  color: var(--primary);
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.55vw, 1.2rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Practices List */
.practices-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
  align-items: stretch;
}

.specialty-card {
  min-height: 132px;
  padding: 22px 22px 20px;
  border: 1px solid rgba(15, 84, 100, 0.14);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-main);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease, background-color 0.2s ease;
}

.specialty-card strong {
  display: block;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  text-wrap: balance;
}

.specialty-card span {
  display: block;
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 1.2vw, 1rem);
  line-height: 1.55;
  overflow-wrap: break-word;
}

.specialty-card:hover,
.specialty-card:focus-visible {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 8px 18px rgba(15, 84, 100, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.specialty-detail-section .info-body {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.specialty-detail-section p {
  max-width: 78ch;
  font-size: 1rem;
  line-height: 1.68;
}

.specialty-subtitle {
  color: var(--primary);
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: -4px;
}

.medical-orientation-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(92, 201, 204, 0.22);
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.specialty-cta-copy {
  margin-top: auto;
  padding-top: 16px;
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.45;
}

.specialty-cta-actions {
  margin-top: 10px;
}

.specialty-discover-btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--secondary);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px rgba(92, 201, 204, 0.26);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.specialty-discover-btn:hover,
.specialty-discover-btn:focus-visible {
  background: var(--primary);
  box-shadow: 0 12px 22px rgba(15, 84, 100, 0.22);
  outline: none;
  transform: translateY(-1px);
}

.anamnesis-start-bar {
  margin-top: auto;
  padding: 24px 28px;
  border: 1px solid rgba(92, 201, 204, 0.24);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.04);
  display: flex;
  align-items: center;
  gap: 24px;
}

.anamnesis-start-bar span {
  flex: 1;
  color: var(--text-main);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.32;
}

.start-anamnesis-btn {
  width: 78px;
  height: 78px;
  min-width: 78px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 24px rgba(92, 201, 204, 0.24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.start-anamnesis-btn:hover,
.start-anamnesis-btn:focus-visible {
  background: var(--primary-hover);
  box-shadow: 0 14px 28px rgba(92, 201, 204, 0.3);
  outline: none;
  transform: translateY(-1px);
}

/* Legal Footer */
.legal-footer {
  background: #12313a;
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: #e9f6f6;
  z-index: 5;
}

.legal-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  text-align: left;
}

.footer-col p {
  margin: 8px 0 0;
  color: rgba(233, 246, 246, 0.82);
  line-height: 1.55;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.footer-col a,
.footer-links a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover,
.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.footer-links .footer-link-button {
  color: var(--secondary) !important;
  border-color: transparent !important;
}

.footer-link-button:hover {
  color: #ffffff;
  text-decoration: underline;
}

.cookie-consent {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 10000;
}

.cookie-consent.hidden,
.cookie-customize-panel.hidden,
#cookie-save-custom.hidden {
  display: none;
}

.cookie-consent-panel {
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 45, 53, 0.18);
}

.cookie-consent-copy h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--text-main);
}

.cookie-consent-copy p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cookie-customize-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f8fbfb;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.cookie-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-main);
  font-size: 0.9rem;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-actions button {
  min-height: 40px;
  min-width: 116px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 9px 14px;
}

.cookie-actions button:hover {
  background: #f0fafa;
}

.install-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 0 auto 14px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: var(--secondary);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(92, 201, 204, 0.24);
  cursor: pointer;
}

.install-app-btn.hidden {
  display: none !important;
}

/* --- Triage Recovery Premium Styles --- */
#recovery-box {
  background: linear-gradient(to right, #f8fbfb, #ffffff, #f8fbfb) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

#recovery-id-input {
  transition: all 0.2s ease;
  background: white;
}

#recovery-id-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(92, 201, 204, 0.1);
  outline: none;
}

#recovery-btn {
  background: var(--primary) !important;
  color: white !important;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease !important;
}

#recovery-btn:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(92, 201, 204, 0.2) !important;
}

#recovery-btn:active {
  transform: translateY(0);
}

/* --- Mobile Responsiveness (max-width: 768px) --- */
/* --- Tablet & Mobile Responsiveness (max-width: 950px) --- */
@media (max-width: 950px) {
  body {
    padding: 0 !important; /* No top gap, banner at the very top */
    overflow-x: hidden;
  }

  #app {
    min-height: var(--app-height);
    border-radius: 0;
    border: none;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Logo & Banner optimization */
  .banner-img {
    max-height: 180px !important; /* Increased to 180px to clear menu button overlap */
    object-position: top !important; /* Never cut the logo head */
    border-radius: 0 !important;
  }

  /* Main Navigation (Improved Mobile Overlay) */
  .main-nav {
    display: none !important; 
    flex-direction: column !important;
    width: 100vw !important;
    min-height: var(--app-height) !important;
    padding: calc(68px + var(--safe-top)) calc(20px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(20px + var(--safe-left)) !important; 
    gap: 12px !important;
    position: fixed !important; /* Independent of banner container */
    top: 0;
    left: 0;
    z-index: 2000 !important; /* On top of everything */
    box-shadow: 0 0 40px rgba(0,0,0,0.2);
    background: white !important;
    border: none;
    overflow-y: auto;
  }

  .main-nav.open {
    display: flex !important;
  }

  .nav-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px !important;
    font-size: 1rem !important;
    border-radius: 12px !important;
    display: flex;
    align-items: center;
    background: #f8fafb;
    border: 1px solid var(--border-color);
  }

  .recovery-nav-group {
    width: 100%;
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    flex-direction: column;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
  }

  #recovery-id-input {
    width: 100% !important;
    max-width: 300px;
    height: 44px;
    font-size: 1rem;
    border-radius: 8px !important;
  }

  .recovery-btn-style {
    width: 100% !important;
    max-width: 300px;
    height: 44px !important;
  }

  .content-container {
    height: calc(var(--app-height) - 180px) !important;
    overflow: hidden !important; /* No double scroll outside */
    display: flex !important;
    flex-direction: column !important;
  }

  /* Chat Area Compactness & Flexibility */
  #chat-section {
    height: 100% !important;
    flex: 1 !important;
    overflow: hidden !important;
    min-height: 0 !important;
  }

  .messages-area {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 16px 16px 12px !important;
    padding-bottom: calc(24px + var(--safe-bottom)) !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .welcome-message {
    margin-top: 5px !important; /* Compattato per mobile */
    margin-bottom: 5px !important;
  }

  .welcome-message .msg-bubble {
    padding: 18px 16px !important;
    border-radius: 16px !important;
  }

  .chat-input-area {
    padding: 12px 14px calc(12px + var(--safe-bottom)) !important;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .chat-input-area textarea {
    font-size: 16px !important;
    padding: 13px 16px !important;
    border-radius: 20px;
    min-height: 50px;
  }

  #menu-toggle {
    display: block !important;
    position: absolute !important;
    bottom: 10px !important;
    top: auto !important;
    right: calc(10px + var(--safe-right)) !important;
    z-index: 1200 !important;
    background: rgba(255, 255, 255, 0.68) !important;
    backdrop-filter: blur(8px) !important;
    padding: 7px 10px !important;
    font-size: 0.78rem !important;
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    border-radius: 999px !important;
  }
}

@media (max-width: 950px) {
  .btn-primary {
    width: 50px;
    height: 50px;
  }

  .msg-bubble {
    font-size: 0.97rem;
  }

  .welcome-title {
    font-size: 1.05rem !important;
    white-space: normal !important;
    line-height: 1.3;
  }

  .welcome-subtitle {
    font-size: 0.9rem !important;
  }

  .chat-footer-links,
  .ai-disclaimer-box {
    margin-left: 14px;
    margin-right: 14px;
  }

  .info-section {
    padding: 18px 16px 24px !important;
  }

  .info-body {
    padding: 0 !important;
  }

  .info-body h2 {
    font-size: 1.3rem;
  }

  .info-body p,
  .g-card,
  .footer-links,
  .footer-copy {
    font-size: 0.95rem;
  }

  .grid-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .g-card {
    padding: 14px 15px;
    border-radius: 14px;
  }

  .cta-container {
    margin-top: 28px;
    gap: 12px;
  }

  .btn-secondary-wide,
  .btn-premium-wide,
  .btn-primary-wide {
    max-width: 100%;
    width: 100%;
  }

  .age-range-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sex-at-birth-options {
    grid-template-columns: 1fr;
  }

  .problem-box,
  .solution-box,
  .impact-stats {
    padding: 18px;
    border-radius: 16px;
  }

  .practices-list {
    grid-template-columns: 1fr;
  }

  .anamnesis-start-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .start-anamnesis-btn {
    width: 60px;
    height: 60px;
    min-width: 60px;
    align-self: flex-end;
    font-size: 1.55rem;
  }

  .section-image {
    max-height: 180px;
    margin-bottom: 18px;
  }

  .modal-content {
    width: calc(100% - 16px);
    max-height: calc(var(--app-height) - 16px);
    padding: 16px 14px;
    gap: 10px;
    border-radius: 18px;
  }

  .modal-scroll {
    max-height: calc(var(--app-height) - 132px);
    font-size: 0.84rem;
    line-height: 1.3;
    padding: 10px;
    border-radius: 12px;
  }

  #privacy-modal .modal-scroll {
    overflow: visible;
    max-height: none;
  }

  #privacy-modal .modal-content {
    overflow-y: auto;
  }

  #glossary-search {
    font-size: 16px !important;
    padding: 14px 16px !important;
  }

  .footer-links a {
    display: inline-block;
    margin: 4px 6px;
  }

  .install-app-btn {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .banner-img {
    max-height: 148px !important;
  }

  .content-container {
    height: calc(var(--app-height) - 148px) !important;
  }

  .messages-area {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .message {
    max-width: 100%;
  }

  .chat-input-area {
    gap: 10px;
  }

  .nav-btn {
    font-size: 0.96rem !important;
  }

  .modal-content {
    width: calc(100% - 16px);
    padding: 14px 12px;
  }

  .modal-content h3 {
    font-size: 1.05rem;
  }

  #privacy-modal .modal-scroll {
    font-size: 0.8rem;
    line-height: 1.24;
  }

  #privacy-modal .age-gate {
    padding: 8px 10px;
  }

  #privacy-modal .age-gate label,
  #privacy-modal .consent-row {
    margin: 5px 0;
    font-size: 0.8rem;
  }

  .section-image {
    max-height: 150px;
  }

  .impact-stats {
    font-size: 0.97rem;
  }

  .btn-secondary-wide,
  .btn-premium-wide {
    font-size: 0.95rem;
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Mobile usability pass: single viewport app, compact header, stable chat. */
@media (max-width: 950px) {
  html,
  body {
    width: 100%;
    height: var(--app-height);
    min-height: var(--app-height);
    overflow: hidden;
  }

  body {
    align-items: stretch;
    padding: 0 !important;
  }

  #app {
    height: var(--app-height);
    min-height: 0;
    overflow: hidden;
    box-shadow: none;
  }

  .chat-header {
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(209, 223, 223, 0.85);
  }

  .banner-wrapper {
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    display: block;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
  }

  .banner-img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: initial !important;
    object-position: initial !important;
    padding: 0 !important;
  }

  .content-container {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  #chat-section {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .messages-area {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .messages-area.choice-mode {
    padding-bottom: calc(188px + var(--safe-bottom)) !important;
  }

  .chat-input-area {
    flex: 0 0 auto;
    position: relative;
    bottom: auto;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(209, 223, 223, 0.85);
    padding-top: 10px !important;
    padding-bottom: calc(10px + var(--safe-bottom)) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .chat-input-area.choice-hidden {
    display: none !important;
  }

  #menu-toggle {
    bottom: 10px !important;
    right: calc(10px + var(--safe-right)) !important;
  }

  .chat-footer-links {
    flex: 0 0 auto;
    padding: 6px 14px 7px !important;
    border-radius: 0;
    line-height: 1.25;
  }

  .ai-disclaimer-box {
    display: none !important;
  }

  .legal-footer {
    flex: 0 0 auto;
    max-height: none;
    overflow-y: visible;
    padding: 18px 14px calc(18px + var(--safe-bottom));
    font-size: 0.72rem;
    -webkit-overflow-scrolling: touch;
  }

  .legal-footer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer-links {
    gap: 7px;
  }

  .cookie-consent {
    inset: auto 10px 10px 10px;
  }

  .cookie-consent-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .cookie-actions {
    justify-content: stretch;
  }

  .cookie-actions button {
    flex: 1 1 130px;
  }

  .welcome-message {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .welcome-message .msg-bubble {
    padding: 12px 14px !important;
    line-height: 1.3 !important;
  }

  .welcome-message .msg-bubble p {
    font-size: 0.86rem !important;
    line-height: 1.32 !important;
    margin-bottom: 7px !important;
  }

  .welcome-title {
    font-size: 1rem !important;
    margin-bottom: 2px !important;
  }

  .welcome-subtitle {
    font-size: 0.82rem !important;
    margin-bottom: 7px !important;
    line-height: 1.25 !important;
  }

  .welcome-disclaimer {
    font-size: 0.76rem !important;
    line-height: 1.28 !important;
    margin-bottom: 8px !important;
  }

  .welcome-message .msg-bubble > div:last-child {
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
  }

  .welcome-message .msg-time {
    display: none;
  }

  .quick-replies {
    display: none !important;
  }

  .quick-reply-btn {
    width: 100%;
    max-width: none;
    min-height: 40px;
    font-size: 0.88rem;
    padding: 7px 10px;
  }

  .quick-choice-letter {
    width: 24px;
    height: 24px;
    font-size: 0.82rem;
  }

  .result-card-main,
  #printable-area {
    padding: 14px !important;
  }

  .result-card-main > div[style*="grid-template-columns"],
  #printable-area div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .banner-img {
    padding: 0 !important;
  }

  .chat-input-area {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .chat-input-area textarea {
    padding-left: 13px !important;
    padding-right: 13px !important;
  }

  .btn-primary {
    width: 46px;
    height: 46px;
  }

  .legal-footer {
    max-height: 58px;
    padding-top: 6px;
    padding-bottom: calc(6px + var(--safe-bottom));
  }
}

/* Base style for Hamburger Toggle (hidden on desktop) */
#menu-toggle {
  display: none;
  background: white;
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  border-radius: 8px;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: absolute;
  z-index: 100;
}

#menu-toggle:active {
  background: var(--bg-color);
  transform: scale(0.95);
}

@media (max-width: 950px) and (hover: hover) and (pointer: fine) {
  .main-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 10px !important;
    position: absolute !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
  }

  .nav-btn {
    width: auto !important;
    padding: 5px 6px !important;
    font-size: clamp(0.58rem, 2vw, 0.9rem) !important;
    border-radius: 20px !important;
  }

  .recovery-nav-group {
    width: auto !important;
    flex-direction: row !important;
    margin-left: 8px !important;
    padding-left: 12px !important;
    padding-top: 0 !important;
    border-top: none !important;
    border-left: 1px solid var(--border-color) !important;
  }

  #recovery-id-input {
    width: 112px !important;
    min-width: 112px !important;
    max-width: none !important;
    height: auto !important;
    font-size: 0.88rem !important;
    border-radius: 8px !important;
  }

  #menu-toggle {
    display: none !important;
  }
}

/* Brand refresh final overrides */
.welcome-title {
  color: var(--primary) !important;
  font-family: var(--font-heading) !important;
  font-size: 48px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em !important;
  margin: 0 auto 24px !important;
}

.welcome-subtitle {
  color: var(--text-main) !important;
  font-family: var(--font-body) !important;
  font-size: 22px !important;
  font-style: normal !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  margin: 0 auto 28px !important;
}

.main-nav {
  background: rgba(243, 251, 251, 0.92) !important;
  border-top: 1px solid rgba(15, 84, 100, 0.08) !important;
}

.nav-btn {
  border-radius: 8px !important;
  color: var(--primary) !important;
  font-family: var(--font-heading) !important;
  font-size: clamp(0.74rem, 1.5vw, 1rem) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
}

.nav-btn.active {
  color: #ffffff !important;
}

#recovery-id-input {
  border-radius: 8px !important;
}

@media (max-width: 950px) {
  .banner-img {
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .welcome-title {
    font-size: 32px !important;
    line-height: 1.15 !important;
  }

  .welcome-subtitle {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }
}

@media (max-width: 480px) {
  .banner-img {
    height: auto !important;
  }
}

.banner-wrapper {
  overflow: visible !important;
}

.banner-img {
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center !important;
}

@media (min-width: 951px), (max-width: 950px) and (hover: hover) and (pointer: fine) {
  .banner-wrapper {
    display: block !important;
    max-width: 1080px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .banner-img {
    width: clamp(760px, 82%, 980px) !important;
    margin: 0 auto 0 16px !important;
  }

  .main-nav {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-height: auto !important;
    gap: 4px !important;
    padding: 9px 8px !important;
    background: rgba(243, 251, 251, 0.92) !important;
    border-top: 1px solid rgba(15, 84, 100, 0.08) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: blur(10px) !important;
  }

  .messages-area {
    padding-top: 40px !important;
  }

  .welcome-message {
    margin-top: 0 !important;
  }

  .welcome-message .msg-bubble {
    padding: 48px 34px 34px !important;
    max-width: 900px !important;
  }

  .welcome-title {
    max-width: 800px !important;
    font-size: 48px !important;
    line-height: 1.1 !important;
    margin-bottom: 24px !important;
  }

  .welcome-subtitle {
    margin-bottom: 28px !important;
  }

  .medical-disclaimer-card {
    margin-bottom: 18px !important;
    padding: 15px 18px !important;
  }

  .initial-intake-card {
    padding-top: 22px !important;
  }
}

@media (min-width: 701px) and (max-width: 950px) {
  .welcome-title {
    font-size: 48px !important;
  }
}

@media (max-width: 700px) {
  .messages-area {
    padding-top: 28px !important;
  }

  .welcome-title {
    font-size: 32px !important;
    line-height: 1.15 !important;
  }
}

/* Header/footer responsive refinement for the official horizontal header image. */
.banner-wrapper {
  background: var(--bg-color) !important;
  overflow: hidden !important;
}

.banner-img {
  display: block;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.legal-footer {
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
}

@media (min-width: 951px), (max-width: 950px) and (hover: hover) and (pointer: fine) {
  .banner-wrapper {
    max-width: 1080px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .banner-img {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 950px) and (hover: none), (max-width: 950px) and (pointer: coarse) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #app {
    height: auto !important;
    min-height: var(--app-height) !important;
    overflow: visible !important;
  }

  .banner-wrapper {
    overflow: hidden !important;
  }

  .banner-img {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 0 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  .chat-footer-links {
    overflow: visible !important;
    white-space: normal !important;
  }

  .content-container,
  #chat-section,
  .messages-area {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .content-container {
    flex: 0 0 auto !important;
  }

  .messages-area {
    flex: 0 0 auto !important;
    padding-bottom: 24px !important;
  }

  .legal-footer {
    flex: 0 0 auto !important;
    padding: 16px 16px calc(84px + var(--safe-bottom)) !important;
    font-size: 0.78rem !important;
    line-height: 1.45 !important;
  }

  .footer-col p,
  .footer-links a,
  .footer-link-button {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) and (hover: none), (max-width: 380px) and (pointer: coarse) {
  .banner-img {
    width: 600px !important;
  }
}

@media screen and (max-width: 950px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #app {
    height: auto !important;
    min-height: var(--app-height) !important;
    overflow: visible !important;
  }

  .banner-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .banner-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  .main-nav {
    display: none !important;
    flex-direction: column !important;
    width: 100vw !important;
    min-height: var(--app-height) !important;
    padding: calc(68px + var(--safe-top)) calc(20px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(20px + var(--safe-left)) !important;
    gap: 12px !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    background: white !important;
    border: none !important;
    overflow-y: auto !important;
  }

  .main-nav.open {
    display: flex !important;
  }

  #menu-toggle {
    display: block !important;
    right: calc(10px + var(--safe-right)) !important;
    bottom: 10px !important;
  }

  .content-container,
  #chat-section,
  .messages-area {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .content-container {
    flex: 0 0 auto !important;
  }

  #chat-section {
    display: flex !important;
    flex-direction: column !important;
  }

  .messages-area {
    flex: 0 0 auto !important;
    padding-bottom: 24px !important;
  }

  .legal-footer {
    flex: 0 0 auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

@media screen and (max-width: 380px) {
  .banner-img {
    width: 100% !important;
  }
}

/* Mobile scroll repair: keep the page scrollable; only the opened menu locks body scroll. */
@media screen and (max-width: 950px) {
  html,
  body:not(.menu-open) {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    padding: 0 !important;
    overscroll-behavior-y: auto !important;
  }

  body.menu-open {
    overflow: hidden !important;
  }

  #app,
  .content-container,
  #chat-section,
  .chat-container,
  .messages-area {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #app {
    min-height: 100vh !important;
    border-radius: 0 !important;
  }

  #chat-section {
    display: flex !important;
    flex-direction: column !important;
  }

  .messages-area {
    flex: 0 0 auto !important;
    padding: 28px 14px 24px !important;
  }

  .banner-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: var(--bg-color) !important;
  }

  .banner-img {
    width: clamp(480px, 126vw, 560px) !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  .main-nav {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav.open {
    display: flex !important;
  }

  #menu-toggle {
    display: block !important;
    right: calc(10px + var(--safe-right)) !important;
    bottom: 10px !important;
  }

  .chat-footer-links,
  .legal-footer {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .legal-footer {
    display: block !important;
    padding: 18px 16px calc(88px + var(--safe-bottom)) !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
  }

  .legal-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .footer-links {
    gap: 10px !important;
  }

  .footer-links a,
  .footer-link-button,
  .footer-col p {
    font-size: inherit !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere;
  }

  .cookie-consent {
    inset: auto 10px calc(10px + var(--safe-bottom)) 10px !important;
    max-height: calc(100dvh - 20px - var(--safe-bottom)) !important;
    overflow-y: auto !important;
  }
}

@media screen and (max-width: 380px) {
  .banner-img {
    width: 480px !important;
  }
}

/* Section navigation guard: hidden sections must beat mobile id-based flex overrides. */
.tab-content.hidden-section,
#chat-section.hidden-section,
#about-section.hidden-section,
#specialists-section.hidden-section,
#glossary-section.hidden-section,
#practices-section.hidden-section,
.specialty-detail-section.hidden-section {
  display: none !important;
  visibility: hidden !important;
}

/* --- PDF PRINT OPTIMIZATION --- */
#printable-area {
  display: block !important;
  visibility: visible !important;
  background: white !important;
  color: #333 !important;
  padding: 20px;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.result-card-main {
  page-break-inside: avoid;
  margin-bottom: 20px;
  border: 1px solid #eee;
  padding: 20px;
  border-radius: 8px;
}

.triage-result {
  page-break-inside: avoid;
  margin-bottom: 10px;
}

.html2pdf__page-break {
  display: block;
  height: 0;
  page-break-before: always;
}

@media print {
  body {
    background: white;
    padding: 0;
  }
  #app {
    box-shadow: none;
    border: none;
  }
}

@media (min-width: 951px), (max-width: 950px) and (hover: hover) and (pointer: fine) {
  .main-nav {
    gap: 4px !important;
    padding: 9px 8px !important;
  }

  .main-nav .nav-btn {
    font-size: clamp(0.78rem, 1.3vw, 0.9rem) !important;
  }
}

/* CMO typography system - source: "Invio e-mail AIutoDoc_Design_System_Aggiornato.pdf" */
body,
.msg-bubble,
.info-body li,
.modal-content,
.cookie-consent,
.result-card-main {
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 170% !important;
  letter-spacing: 0 !important;
  color: var(--text-main) !important;
}

.message.user-msg .msg-bubble {
  color: #f4ffff !important;
}

.welcome-title,
.info-body h1 {
  max-width: 800px !important;
  font-family: var(--font-heading) !important;
  font-size: 48px !important;
  font-weight: 700 !important;
  line-height: 110% !important;
  letter-spacing: -0.03em !important;
  color: var(--primary) !important;
}

.info-body h2,
#cookie-consent-title {
  font-family: var(--font-heading) !important;
  font-size: 36px !important;
  font-weight: 700 !important;
  line-height: 120% !important;
  letter-spacing: -0.02em !important;
  color: var(--primary) !important;
}

.info-body h3,
.initial-intake-card h3,
.showcase-card h3,
.problem-box h3,
.solution-box h3,
.plus-showcase h3,
.g-card strong,
.specialty-card strong,
.medical-disclaimer-card strong {
  font-family: var(--font-heading) !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 130% !important;
  letter-spacing: -0.01em !important;
  color: var(--primary) !important;
}

.welcome-subtitle,
.specialty-subtitle {
  font-family: var(--font-body) !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 145% !important;
  letter-spacing: 0 !important;
  color: var(--text-main) !important;
}

.welcome-message .msg-bubble > p,
.info-body p,
.specialty-detail-section p,
.info-body .lead,
.initial-intake-card p:first-of-type {
  font-family: var(--font-body) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 165% !important;
  letter-spacing: 0 !important;
  color: var(--text-main) !important;
}

.brand-text .subtitle,
.welcome-disclaimer,
.g-card,
.specialty-card span,
.showcase-card li,
.specialty-cta-copy,
.legal-footer,
.cookie-consent p,
.medical-disclaimer-card p {
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 170% !important;
  letter-spacing: 0.01em !important;
  color: var(--text-muted) !important;
}

.medical-disclaimer-card,
.ai-disclaimer-box,
#medical-disclaimer-start {
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 170% !important;
  letter-spacing: 0.01em !important;
  color: var(--text-muted) !important;
}

.welcome-message .msg-bubble {
  padding-top: 48px !important;
}

.welcome-title {
  margin-bottom: 24px !important;
}

.welcome-subtitle {
  margin-bottom: 28px !important;
}

.welcome-message .msg-bubble > p {
  margin-bottom: 20px !important;
}

.welcome-disclaimer {
  margin-bottom: 32px !important;
}

button,
.btn-primary,
.btn-primary-wide,
.btn-premium-wide,
.specialty-discover-btn,
.cookie-actions button {
  font-family: var(--font-heading) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 100% !important;
  letter-spacing: -0.01em !important;
}

.btn-primary,
.btn-primary-wide,
.btn-premium-wide,
.specialty-discover-btn,
.cookie-actions button:first-child {
  background: var(--secondary) !important;
  color: #FFFFFF !important;
}

.btn-primary:hover,
.btn-primary-wide:hover,
.btn-premium-wide:hover,
.specialty-discover-btn:hover,
.cookie-actions button:first-child:hover {
  background: var(--primary) !important;
  color: #FFFFFF !important;
}

.btn-secondary-wide,
.footer-link-button,
.nav-btn,
.cookie-actions button:not(:first-child) {
  font-family: var(--font-heading) !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 100% !important;
  letter-spacing: -0.01em !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

label,
.initial-field span,
.consent-row,
.age-gate label {
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 140% !important;
  letter-spacing: 0.01em !important;
  color: var(--primary) !important;
}

input,
textarea,
select,
#glossary-search,
#recovery-id-input,
.chat-input-area textarea,
.initial-field input[type="number"] {
  font-family: var(--font-body) !important;
  font-size: 17px !important;
  font-weight: 400 !important;
  line-height: 150% !important;
  letter-spacing: 0 !important;
  color: var(--text-main) !important;
}

@media (max-width: 700px) {
  .practices-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .specialty-card {
    min-height: 120px;
    padding: 18px 18px 16px;
  }

  .specialty-card strong {
    font-size: 1.02rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.005em !important;
    text-wrap: pretty;
  }

  .specialty-card span {
    font-size: 0.98rem !important;
    line-height: 1.5 !important;
  }

  body,
  .msg-bubble,
  .info-body p,
  .info-body li,
  .modal-content,
  .cookie-consent,
  .result-card-main,
  .specialty-detail-section p {
    font-size: 15px !important;
    line-height: 175% !important;
  }

  .welcome-title,
  .info-body h1 {
    font-size: 32px !important;
    line-height: 115% !important;
    letter-spacing: -0.02em !important;
  }

  .info-body h2,
  #cookie-consent-title {
    font-size: 28px !important;
    line-height: 125% !important;
  }

  .info-body h3,
  .initial-intake-card h3,
  .showcase-card h3,
  .problem-box h3,
  .solution-box h3,
  .plus-showcase h3,
  .g-card strong,
  .specialty-card strong,
  .medical-disclaimer-card strong {
    font-size: 22px !important;
    line-height: 130% !important;
  }

  .welcome-subtitle,
  .specialty-subtitle {
    font-size: 18px !important;
    line-height: 150% !important;
  }

  .welcome-message .msg-bubble > p,
  .info-body p,
  .specialty-detail-section p,
  .info-body .lead,
  .initial-intake-card p:first-of-type {
    font-size: 16px !important;
    line-height: 170% !important;
  }

  .brand-text .subtitle,
  .welcome-disclaimer,
  .g-card,
  .specialty-card span,
  .showcase-card li,
  .specialty-cta-copy,
  .legal-footer,
  .cookie-consent p,
  .medical-disclaimer-card p {
    font-size: 15px !important;
  }

  .medical-disclaimer-card,
  .ai-disclaimer-box,
  #medical-disclaimer-start {
    font-size: 13px !important;
  }

  button,
  .btn-primary,
  .btn-primary-wide,
  .btn-premium-wide,
  .specialty-discover-btn,
  .cookie-actions button {
    font-size: 17px !important;
  }
}

