:root {
  --brand: #347461;
  --brand-dark: #263934;
  --brand-soft: #dcebe5;
  --warning: #d89b2b;
  --danger: #d9554f;
  --ink: #253530;
  --muted: #747d79;
  --line: #deded8;
  --panel: #ffffff;
  --bg: #f7f7f4;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: #e9ece8;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.phone-shell {
  width: 100vw;
  height: 100svh;
  min-height: 100svh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

@media (min-width: 520px) {
  .phone-shell {
    width: 390px;
    height: min(932px, 100dvh);
    min-height: min(932px, 100dvh);
    border-radius: 18px;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.18);
  }
}

.screen {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px calc(118px + env(safe-area-inset-bottom));
}

@supports (height: 100dvh) {
  .phone-shell {
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (max-width: 519px) {
  body {
    display: block;
    background: var(--bg);
  }
}

.center {
  text-align: center;
}

.start {
  padding: 16px 32px calc(28px + env(safe-area-inset-bottom));
}

.start-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  margin: clamp(28px, 7dvh, 52px) auto 22px;
  display: block;
}

.app-title {
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--brand-dark);
}

.sub {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 16px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 56px;
}

.choice-card,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* 질병관리청 연령대 비교 카드 — 주최기관 공공데이터 가시화 */
.bench-card {
  padding: 14px 16px;
  margin: 12px 0;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
}
.bench-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.bench-head strong {
  color: var(--brand-dark);
  font-size: 15px;
}
.bench-src {
  font-size: 11px;
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}
.bench-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.bench-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--ink);
}
.bench-chip strong {
  color: var(--brand-dark);
}
.bench-poly {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 8px;
}
.bench-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* 예방접종 상담 권고 카드 — 질병청 감염병 라이브 API 근거 */
.advisory-card {
  padding: 14px 16px;
  margin: 12px 0;
  border-left: 4px solid var(--warning);
  background: #fff7ec;
}

/* 약물별 위험도 (v2.0 §5.2/5.3) — 개수 요약 칩 → 클릭 시 해당 약물 */
.drug-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 4px 0 8px;
}
.drug-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drug-cat.active {
  border-color: var(--cat);
  background: color-mix(in srgb, var(--cat) 12%, var(--panel));
}
.drug-cat-n {
  font-size: 19px;
  font-weight: 800;
  color: var(--cat);
  line-height: 1;
}
.drug-cat-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.drug-cat-hint {
  margin: 2px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.drug-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 6px 0 8px;
}
.drug-risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.drug-risk-card {
  padding: 12px 14px;
}
.drug-risk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.drug-risk-head strong {
  color: var(--ink);
  font-size: 14.5px;
}
.drug-grade-pill {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.drug-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.drug-tag {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.drug-tag.muted {
  background: #f0f0ec;
  color: var(--muted);
}

.choice-card {
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--ink);
}

.choice-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
}

.icon-line {
  width: 32px;
  height: 32px;
  color: var(--brand);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
}

.primary-btn {
  border: 0;
  color: white;
  background: var(--brand);
}

.secondary-btn {
  border: 1px solid var(--brand);
  color: var(--brand);
  background: white;
}

.foot-note {
  margin-top: 18px;
  font-size: 13px;
  color: #7a817d;
}

.topbar {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: 12px;
}

.back-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  cursor: pointer;
}

.top-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
}

.mini-logo {
  width: 22px;
  height: 22px;
}

.step {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 22px 0 14px;
}

.progress span {
  height: 4px;
  border-radius: 99px;
  background: #dfdfda;
}

.progress span.active {
  background: var(--brand);
}

.headline {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 900;
}

.hint {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.card {
  padding: 14px;
  margin-bottom: 10px;
}

.age-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 74px;
}

.subtle-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.round-btn {
  height: 44px;
  width: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  font-size: 24px;
  cursor: pointer;
}

.age-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  width: 100%;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
}

.age-value-input {
  width: min(100%, 92px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
  font: inherit;
}

.age-value-input::-webkit-outer-spin-button,
.age-value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.age-value-input:focus {
  color: var(--brand-dark);
}

.age-value-input::placeholder {
  color: var(--muted);
}

.age-value span {
  font-size: 15px;
  font-weight: 500;
  margin-left: 3px;
}

.toggle-row {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-weight: 700;
}

.toggle {
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: #d6d6d0;
  position: relative;
  border: 0;
  cursor: pointer;
}

.toggle::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 3px;
  left: 3px;
}

.toggle.on {
  background: var(--brand);
}

.toggle.on::after {
  left: 23px;
}

.input-card h3 {
  min-height: 28px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
}

.search {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: white;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.chip {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
}

.chip-button {
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.dose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dose label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.dose input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 10px;
}

.dose-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 6px;
}

.dose select {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
}

.dose .custom-unit-input {
  margin-top: 6px;
}

.result-score {
  padding: 14px 14px 18px;
  text-align: center;
}

.score-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.score-stack strong {
  display: block;
  margin-top: 14px;
  text-align: center;
  line-height: 1.25;
  word-break: keep-all;
  position: relative;
  z-index: 1;
}

.gauge-wrap {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 310px);
  height: 180px;
  margin: 0;
  z-index: 0;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.gauge-track,
.gauge-fill {
  fill: none;
  stroke-width: 13;
  stroke-linecap: round;
}

.gauge-track {
  stroke: #e7e7e3;
}

.gauge-svg text {
  fill: #6f7874;
  font-size: 13px;
  font-weight: 800;
}

.score-number {
  font-size: 54px;
  line-height: 0.95;
  color: var(--warning);
  font-weight: 900;
  margin-top: 55px; /* 게이지 안으로 밀어 넣는 핵심 수치 */
  position: relative;
  z-index: 1;
}

.score-total {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.pill {
  display: inline-block;
  margin: 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: #fff0d4;
  color: var(--warning);
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.new-med-pill {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 9px;
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.metric {
  display: grid;
  align-content: center;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
  color: var(--brand);
}

.metric.warning strong {
  color: var(--warning);
}

.bar {
  height: 4px;
  background: #e3e3de;
  border-radius: 99px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 32%;
  background: var(--brand);
}

.metric.warning .bar span {
  width: 48%;
  background: var(--warning);
}

.section-title {
  margin: 12px 0 8px;
  font-size: 18px;
}

.risk-list {
  padding: 8px;
}

.risk-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 7px;
  border-radius: 10px;
  background: #f7f3ed;
  margin-bottom: 8px;
}

.risk-mark {
  color: #6f7874;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
}

.risk-item strong {
  display: block;
  font-size: 13px;
}

.risk-item span {
  color: var(--muted);
  font-size: 12px;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border-top: 1px solid #eee;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}

.tab {
  border: 0;
  background: white;
  color: #69716d;
  font-size: 15.5px;
  display: grid;
  grid-template-rows: 32px 22px;
  align-items: center;
  justify-items: center;
  align-content: center;
  gap: 6px;
  cursor: pointer;
  min-width: 0;
  line-height: 1.15;
}

.tab.active {
  color: var(--brand);
  font-weight: 800;
}

.tab-icon {
  width: 30px;
  height: 30px;
  display: block;
  line-height: 1;
  margin: 0 auto;
  flex: 0 0 30px;
}

.simple-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.list-card {
  min-height: 78px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

button.list-card {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.list-card strong {
  display: block;
  margin-bottom: 4px;
}

.list-card span {
  color: var(--muted);
  font-size: 13px;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 21px;
  font-weight: 900;
}

.home-brand img {
  width: 28px;
  height: 28px;
}

.home-title {
  margin: 24px 0 8px;
  font-size: 31px;
  line-height: 1.25;
  font-weight: 900;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 24px;
}

.stat-card {
  min-height: 84px;
  display: grid;
  place-items: center;
  text-align: center;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.notice-card {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  background: #e2f0ea;
  border: 0;
  color: var(--brand);
  font-size: 13px;
  line-height: 1.5;
}

.result-notice {
  margin: 12px 0;
}

.check-error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffefeb;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.empty-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  color: var(--ink);
}

.empty-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.detail-section h3 {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}

.question {
  margin: 14px 0 8px;
  font-weight: 800;
  font-size: 14px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-row.option-count-2,
.option-row.option-count-3,
.option-row.option-count-4 {
  display: flex;
}

.option {
  min-height: 36px;
  width: auto;
  flex: 1 1 auto;
  min-width: max-content;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1.2;
  font-size: clamp(11px, 3vw, 14px);
}

.option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.med-manage-card {
  display: grid;
  gap: 12px;
}

.med-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.med-row strong,
.med-row span {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.med-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.med-actions,
.manage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn,
.delete-btn,
.small-btn {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 14px;
}

.delete-btn {
  border: 1px solid #f1c5c1;
  background: #fff8f7;
  color: var(--danger);
  font-weight: 800;
  cursor: pointer;
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}

.manage-grid label {
  color: var(--muted);
  font-size: 12px;
}

.manage-grid input {
  width: 100%;
  height: 38px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: white;
  color: var(--ink);
}

.unit-input {
  height: 38px;
  margin-top: 5px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.unit-input input {
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.unit-input span {
  padding-right: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-card:hover,
.option:hover,
.choice-card:hover {
  border-color: #b9cbc4;
}

.result-screen {
  padding-top: 10px;
  padding-bottom: 96px;
}

.result-screen .topbar {
  margin-top: 8px;
}

.result-screen .card {
  margin-bottom: 8px;
}

.result-screen .result-score {
  padding: 14px 14px 18px;
}

.result-screen .gauge-wrap {
  width: min(100%, 280px);
  height: 162px;
  margin-bottom: 2px;
}

.result-screen .score-number {
  font-size: 54px;
}

.result-screen .pill {
  margin: 5px 0;
}

.result-screen .metric {
  min-height: 78px;
  padding: 12px;
}

.result-screen .metric strong {
  font-size: 25px;
}

.result-screen .section-title {
  margin: 8px 0 6px;
  font-size: 17px;
}

.result-screen .risk-list {
  padding: 7px;
}

.result-screen .risk-item {
  min-height: 42px;
  margin-bottom: 6px;
  padding: 6px;
}

.result-screen .primary-btn,
.result-screen .secondary-btn {
  min-height: 50px;
}

/* Design alignment overrides */
.ui-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.icon-text-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toggle {
  flex: 0 0 48px;
}

.search .ui-icon {
  width: 20px;
  height: 20px;
}

.medicine-search {
  width: 100%;
  cursor: text;
}

.medicine-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.history-search input,
.medicine-search input {
  width: 100%;
}

.medicine-search input::placeholder {
  color: #8a918d;
}

.medicine-search span {
  display: flex;
  align-items: center;
  color: #6f7874;
}

.inline-add {
  flex: 0 0 54px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: white;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.ocr-note {
  margin: -4px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e2f0ea;
  color: var(--brand);
  font-size: 13px;
  line-height: 1.4;
}

.ocr-review-note {
  margin: -2px 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff0f3;
  color: #b3445a;
  font-size: 13px;
  line-height: 1.45;
}

.ocr-review-note.always {
  margin: 8px 0 0;
  background: #f7f4ec;
  color: #6f6352;
}

.detail-free-text {
  margin-top: 14px;
}

.detail-free-text span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-free-text input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

.confirm-card {
  padding: 14px;
}

.confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.confirm-head button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

.confirm-pill-list {
  display: grid;
  gap: 10px;
}

.confirm-pill-list span {
  padding: 13px;
  border-radius: 10px;
  background: #f7f3ed;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confirm-pill-list.danger span {
  background: #fff0ee;
}

.confirm-pill-list em {
  flex: 0 0 auto;
  font-style: normal;
  color: #e4544b;
  border: 1px solid #e4544b;
  border-radius: 999px;
  padding: 2px 9px;
}

.compact {
  min-height: auto;
  margin-top: 4px;
}

.evidence-card {
  padding: 16px;
}

.evidence-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.evidence-card > div:first-child strong {
  min-width: 0;
  flex: 1 1 180px;
  line-height: 1.25;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.evidence-card > div:first-child span {
  border: 1px solid var(--brand);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand);
  font-size: 12px;
  white-space: nowrap;
}

.evidence-card p {
  margin: 10px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.evidence-card small,
.evidence-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.evidence-card small button,
.evidence-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.full-evidence-detail {
  white-space: pre-line;
}

.action-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.action-card {
  min-height: 84px;
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  align-items: start;
}

.action-card > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e2f0ea;
  color: var(--brand);
  font-size: 20px;
  font-weight: 900;
  margin-top: 2px;
}

.collapsible-text p {
  display: block;
  margin: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.collapsible-text:not(.expanded) p {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collapsible-text button {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.action-detail p {
  font-size: 15px;
  line-height: 1.38;
  letter-spacing: 0;
  font-weight: 800;
}

.evidence-detail p {
  font-size: 14px;
  line-height: 1.55;
}

.full-evidence-detail {
  display: block;
  margin: 10px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
  white-space: pre-line;
}

.action-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  word-break: keep-all;
}

.consult-card,
.summary-card {
  background: #e2f0ea;
  border-color: #c8ded5;
}

.consult-card h3 {
  margin: 0 0 12px;
  color: var(--brand);
  display: flex;
  gap: 8px;
  align-items: center;
}

.consult-card div:not(:first-child),
.summary-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(52, 116, 97, 0.18);
  font-size: 12px;
  line-height: 1.35;
}

.consult-card span,
.summary-row span {
  color: var(--brand);
  font-weight: 800;
}

.consult-card strong,
.summary-row strong {
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.summary-lead {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  margin: 24px 0 16px;
}

.summary-card {
  padding: 16px;
  background: white;
}

.summary-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  font-size: 14px;
}

.summary-title span,
.summary-card small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.summary-card small {
  display: block;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.summary-risk {
  margin: 14px 0;
  padding: 14px;
  border-radius: 10px;
}

.summary-risk span {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 14px;
  margin-right: 12px;
}

.summary-risk strong {
  font-size: 25px;
}

.summary-risk p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.summary-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 10px;
}

.summary-actions .secondary-btn {
  min-height: 52px;
  font-size: 13px;
  display: grid;
  place-items: center;
  gap: 3px;
}

.save-feedback {
  min-height: 0;
  margin: 0;
  color: var(--brand);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.save-feedback:not(:empty) {
  margin: 8px 0 10px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 4px 8px;
}

.section-head h2,
.subsection-title {
  margin: 0;
  color: var(--brand);
  font-size: 19px;
}

.section-head span {
  padding: 4px 10px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  color: var(--brand);
  font-size: 12px;
}

.medicine-group {
  padding: 0 14px;
  overflow: hidden;
}

.subsection-title {
  margin: 24px 4px 8px;
}

.med-manage-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.medicine-group > .med-manage-card.card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
}

.med-manage-card:last-child {
  border-bottom: 0;
}

.icon-only {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #6f7874;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.icon-only .ui-icon {
  width: 20px;
  height: 20px;
}

.text-action-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: white;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.history-search {
  margin-top: 14px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.filter-row button {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-weight: 700;
}

.filter-row .selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.history-result-card {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.history-result-card strong {
  display: block;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.history-result-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.history-score {
  text-align: right;
  min-width: 72px;
}

.history-score span {
  display: inline-block;
  margin: 0 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  min-width: 64px;
  text-align: center;
  white-space: nowrap;
}

.history-score strong {
  display: block;
  font-size: 18px;
}

.metric strong small {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  margin-left: 2px;
}

.metric-caption {
  margin: 8px 2px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.pending-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff0d4;
  color: #8a6420;
  font-size: 12px;
  font-weight: 700;
}
