* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f8fafc;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search-header {
    background: #ffffff;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.search-box {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

#symptomInput {
    width: 100%;
    height: 64px;
    border: 1.5px solid #2563eb;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    padding: 0 72px 0 58px;
    font-size: 18px;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

#symptomInput::placeholder {
    color: #64748b;
}

#symptomInput:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.search-icon {
    position: absolute;
    left: 22px;
    width: 24px;
    height: 24px;
    color: #2563eb;
    pointer-events: none;
}

#micButton {
    position: absolute;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #2563eb;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#micButton:hover {
    background: #dbeafe;
}

#micButton:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

#micButton svg {
    width: 22px;
    height: 22px;
}

.mic-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stop-icon {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}

#micButton.listening .mic-icon {
    display: none;
}

#micButton.listening .stop-icon {
    display: flex;
}

#micButton.listening {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    50% {
        transform: scale(1.08);
    }
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

section {
    margin-bottom: 36px;
}

h2 {
    margin: 0 0 16px;
    font-size: 22px;
    color: #0f172a;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 20px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #1e293b;
    font: inherit;
}

.symptom-chip {
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.symptom-chip.editing {
    padding-right: 10px;
    user-select: text;
}

.symptom-label {
    outline: none;
    white-space: nowrap;
}

.symptom-chip.editing .symptom-label {
    min-width: 20px;
    cursor: text;
    user-select: text;
}

.chip-delete {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 18px;
    line-height: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.chip-delete[hidden] {
    display: none;
}

.chip-delete:not([hidden]) {
    display: inline-flex;
}

.chip-delete:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.chip-delete:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.waiting {
    color: #64748b;
}

.share {
    margin-top: 20px;
    padding: 14px 28px;
    border: 0;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
}

.share:hover {
    background: #1d4ed8;
}

.share:active {
    transform: translateY(1px);
}

.share:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .search-header {
        padding: 16px;
    }

    #symptomInput {
        height: 58px;
        padding-left: 52px;
        padding-right: 66px;
        font-size: 16px;
    }

    .search-icon {
        left: 18px;
        width: 22px;
        height: 22px;
    }

    #micButton {
        right: 9px;
        width: 40px;
        height: 40px;
    }

    main {
        padding: 32px 16px;
    }

    section {
        margin-bottom: 32px;
    }

    h2 {
        font-size: 20px;
    }

    #symptoms {
        min-width: 0;
    }

    .symptom-chip {
        align-items: flex-start;
        width: auto;
        max-width: 100%;
        min-width: 0;
        height: auto;
        padding: 9px 14px;
        border-radius: 18px;
        box-sizing: border-box;
    }

    .symptom-label {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* NARROW_SEASON3_UI_START */

#narrow-context-section,
#narrow-check-next-section {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  align-self: stretch;
  justify-self: stretch;
}

#narrow-context-section {
  margin-top: 28px;
}

#narrow-context-section .narrow-context-box {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin-top: 12px;
}

#narrow-context-section .narrow-context-entry {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 50px;
  box-sizing: border-box;
  border: 1px solid #d6dee9;
  border-radius: 16px;
  background: #ffffff;
  padding: 6px 7px 6px 13px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

#narrow-context-section .narrow-context-entry:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}

#narrow-context-section .narrow-context-entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  margin-right: 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
}

#narrow-context-section .narrow-context-input {
  appearance: none;
  flex: 1 1 auto;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 38px;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #0f172a;
  font: inherit;
  font-size: 15px;
}

#narrow-context-section .narrow-context-input:focus {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

#narrow-context-section .narrow-context-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

#narrow-context-section .narrow-context-add {
  appearance: none;
  flex: 0 0 auto;
  height: 38px;
  min-width: 62px;
  margin: 0 0 0 10px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

#narrow-context-section .narrow-context-add:hover {
  background: #1d4ed8;
}

#narrow-context-section .narrow-context-add:active {
  transform: translateY(1px);
}

#narrow-context-section .narrow-context-helper {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

#narrow-context-section .narrow-context-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

#narrow-context-section .narrow-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  box-sizing: border-box;
  border: 1px solid #d6dee9;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  line-height: 1.2;
  padding: 7px 8px 7px 13px;
}

#narrow-context-section .narrow-context-chip button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  line-height: 1;
}

#narrow-context-section .narrow-context-chip button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

#narrow-check-next-section {
  margin-top: 28px;
}

#narrow-check-next-section .narrow-check-next-items {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 12px;
}

#narrow-check-next-section .narrow-check-next-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d6dee9;
  border-radius: 999px;
  background: #ffffff;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 7px 14px 7px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

#narrow-check-next-section .narrow-check-next-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
}

#narrow-check-next-section .narrow-check-next-icon svg {
  display: block;
  width: 13px;
  height: 13px;
}

#narrow-check-next-section .narrow-check-next-label {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
}

#narrow-check-next-section .narrow-check-next-empty {
  margin-top: 10px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  #narrow-context-section .narrow-context-entry {
    border-radius: 14px;
  }

  #narrow-context-section .narrow-context-add {
    min-width: 54px;
    padding: 0 12px;
  }

  #narrow-check-next-section .narrow-check-next-label {
    white-space: normal;
  }
}

/* NARROW_SEASON3_UI_END */

/* NARROW_CLINICAL_PRODUCT_INTAKE_START */

.product-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 32px 24px;
}

.product-header > div {
    max-width: 900px;
    margin: 0 auto;
}

.product-header h1 {
    margin: 4px 0 8px;
    color: #0f172a;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.product-eyebrow,
.step-label {
    margin: 0 0 6px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.product-intro {
    max-width: 660px;
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.55;
}

.product-safety-note {
    max-width: 760px;
    margin-top: 14px;
    color: #52627a;
    font-size: 0.95rem;
    line-height: 1.55;
}

#body-location-section,
#symptom-intake-section,
#timing-section,
#narrow-context-section,
main > section[aria-labelledby="evidenceHeading"] {
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section-heading-row h2 {
    margin-bottom: 0;
}

.subject-control,
.timing-fields label,
.location-fields label {
    display: grid;
    gap: 7px;
    color: #475569;
    font-size: 13px;
    font-weight: 650;
}

.subject-control select,
.timing-fields select,
.location-fields select {
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    padding: 0 36px 0 12px;
}

.subject-control select:focus,
.timing-fields select:focus,
.location-fields select:focus {
    border-color: #2563eb;
    outline: 3px solid rgba(37, 99, 235, 0.12);
}

.body-location-selector {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.body-view-controls {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #f1f5f9;
}

.body-view-button {
    min-width: 86px;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
}

.body-view-button.is-active {
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.body-selector-grid {
    display: grid;
    grid-template-columns: minmax(150px, 0.62fr) minmax(0, 1.7fr);
    gap: 24px;
    margin-top: 18px;
}

.body-figure-panel {
    display: flex;
    min-height: 390px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid #e7edf5;
    background:
        radial-gradient(circle at 50% 28%, #ffffff 0, #f8fbff 46%, #f1f6fc 100%);
}

.body-figure {
    display: grid;
    justify-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.body-figure[hidden] {
    display: none;
}

.body-figure svg {
    width: 166px;
    height: 342px;
    overflow: visible;
    filter: drop-shadow(0 12px 18px rgba(37, 99, 235, 0.08));
}

.body-figure svg .body-zone {
    fill: url(#frontBodyFill);
    stroke: #7ca6dc;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition:
        fill 160ms ease,
        stroke 160ms ease,
        filter 160ms ease;
}

.body-figure[data-body-figure="back"] svg .body-zone {
    fill: url(#backBodyFill);
}

.body-figure svg .body-zone.is-selected {
    fill: #3b82f6;
    stroke: #1d4ed8;
    filter: drop-shadow(0 4px 5px rgba(37, 99, 235, 0.24));
}

.body-figure svg .body-detail {
    fill: none;
    stroke: #afc7e5;
    stroke-linecap: round;
    stroke-width: 1.5;
}

.body-figure svg .body-spine {
    fill: none;
    stroke: #4f86c6;
    stroke-dasharray: 5 6;
    stroke-linecap: round;
    stroke-width: 2.4;
}

.body-figure svg .body-landmark {
    fill: #7ca6dc;
    stroke: none;
}

.body-region-panel {
    min-width: 0;
}

.field-label {
    margin: 0 0 10px;
    color: #475569;
    font-size: 13px;
    font-weight: 650;
}

.body-region-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.body-region-buttons button {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
}

.body-region-buttons button:hover,
.body-region-buttons button:focus-visible {
    border-color: #2563eb;
    color: #1d4ed8;
}

.body-region-buttons button.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

.location-fields,
.timing-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.timing-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 620px;
}

.selected-location-summary {
    min-height: 24px;
    margin: 14px 0 0;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 650;
}

#symptom-intake-section .search-box {
    max-width: none;
}

#symptom-intake-section #symptomInput {
    height: 58px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.input-normalization-note {
    margin: 10px 0 0;
    color: #475569;
    font-size: 13px;
}

#symptoms {
    margin-top: 14px;
}

.evidence-entry,
main > section[aria-labelledby="evidenceHeading"] .narrow-context-entry {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    border: 1px solid #d6dee9;
    border-radius: 16px;
    background: #ffffff;
    padding: 6px 7px 6px 13px;
}

.evidence-entry .narrow-context-entry-icon,
main > section[aria-labelledby="evidenceHeading"] .narrow-context-entry-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    margin-right: 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 19px;
}

.evidence-entry .narrow-context-input,
main > section[aria-labelledby="evidenceHeading"] .narrow-context-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
}

.evidence-entry .narrow-context-add,
main > section[aria-labelledby="evidenceHeading"] .narrow-context-add {
    flex: 0 0 auto;
    min-width: 62px;
    height: 38px;
    margin-left: 10px;
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
}

#patient-evidence-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.clinical-result-list {
    display: grid;
    gap: 10px;
}

#evidence.clinical-result-list {
    margin-top: 14px;
}

.clinical-result-card,
.clinical-question-card,
.clinical-outcome-card,
.clinical-routing-card,
.clinical-evidence-card,
.clinical-safety-card {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    color: #1e293b;
}

.clinical-result-card strong,
.clinical-question-card strong,
.clinical-outcome-card strong,
.clinical-routing-card strong,
.clinical-evidence-card strong,
.clinical-safety-card strong {
    font-size: 15px;
    line-height: 1.35;
}

.clinical-result-card span,
.clinical-question-card span,
.clinical-outcome-card span,
.clinical-routing-card span,
.clinical-evidence-card span,
.clinical-safety-card span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.clinical-question-card {
    border-left: 4px solid #2563eb;
}

.clinical-safety-section {
    padding: 18px;
    border: 1px solid #f59e0b;
    border-radius: 18px;
    background: #fffbeb;
}

.clinical-safety-card {
    border-color: #fbbf24;
    background: #ffffff;
}

.clinical-safety-card.is-active {
    border-color: #dc2626;
    background: #fef2f2;
}

html[data-clinical-workflow="error"] #outcomes,
html[data-clinical-workflow="error"] #handlers {
    color: #b91c1c;
}

@media (max-width: 720px) {
    .product-header {
        padding: 24px 16px;
    }

    .section-heading-row {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .body-selector-grid {
        grid-template-columns: 1fr;
    }

    .body-figure-panel {
        min-height: 310px;
    }

    .body-figure svg {
        width: 138px;
        height: 275px;
    }

    .location-fields,
    .timing-fields {
        grid-template-columns: 1fr;
    }

    .body-region-buttons button {
        flex: 1 1 calc(50% - 8px);
    }
}

/* NARROW_CLINICAL_PRODUCT_INTAKE_END */
