:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-strong: #fbfcfb;
  --ink: #172126;
  --muted: #69757a;
  --line: #dde3df;
  --teal: #176b63;
  --teal-dark: #0f514b;
  --coral: #d96a4e;
  --gold: #b98720;
  --blue: #3d6fa8;
  --mint: #dcefe9;
  --rose: #fae4dc;
  --sky: #ddeefa;
  --lavender: #e8e4f5;
  --leaf: #e9f2d7;
  --shadow: 0 14px 36px rgba(23, 33, 38, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 243, 234, 0.92);
  border-bottom: 1px solid rgba(31, 42, 46, 0.08);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  box-shadow:
    0 10px 20px rgba(15, 81, 75, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.brand-mark img {
  display: block;
  width: 38px;
  height: 38px;
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-links a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(35, 124, 115, 0.1);
  color: var(--teal-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.76fr);
  gap: 22px;
  align-items: stretch;
  padding: 36px 0 24px;
}

.input-panel,
.summary-panel,
.section-block,
.stat-card {
  border: 1px solid rgba(31, 42, 46, 0.09);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel {
  min-height: 520px;
  padding: clamp(24px, 5vw, 52px);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.28;
}

.lead {
  max-width: 660px;
  margin: 22px 0 30px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.birthday-form {
  display: grid;
  max-width: 560px;
  gap: 10px;
}

.birthday-form label {
  font-size: 14px;
  font-weight: 900;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.birthday-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 16px;
}

select,
.region-control input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 15px;
}

.birthday-form input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(35, 124, 115, 0.22);
  outline-offset: 2px;
}

.primary-btn,
.ghost-btn,
.chip,
.task-toggle,
.ghost-link {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-btn,
.ghost-btn,
.chip,
.task-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
}

.primary-btn {
  padding: 0 18px;
  background: var(--teal);
  color: white;
}

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

.primary-btn svg,
.ghost-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.ghost-btn {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: rgba(35, 124, 115, 0.35);
  background: var(--mint);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.field-error {
  min-height: 22px;
  margin: 0;
  color: #b92d24;
  font-size: 13px;
  font-weight: 800;
}

.privacy-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-top: 34px;
  padding: 11px 13px;
  border: 1px solid rgba(35, 124, 115, 0.2);
  border-radius: 8px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--teal);
  flex: 0 0 auto;
}

.summary-panel {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 520px;
  padding: 18px;
  border-radius: 8px;
  background: #eef5f2;
}

.preview-head,
.preview-calendar,
.preview-list {
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.preview-head {
  padding: 18px;
}

.small-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.preview-head strong {
  display: block;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
}

.preview-head p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.preview-calendar {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.preview-calendar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.preview-calendar-top span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.preview-calendar-top strong {
  font-size: 18px;
}

.preview-weekdays,
.preview-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.preview-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.preview-day {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #f4f7f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.preview-day.has-event {
  background: var(--mint);
  color: var(--teal-dark);
}

.preview-day.today {
  background: var(--teal);
  color: #fff;
}

.preview-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.preview-list-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.preview-list-item strong {
  display: block;
  font-size: 14px;
}

.preview-list-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--teal);
}

.category-dot.checkup {
  background: var(--blue);
}

.category-dot.vaccine {
  background: var(--teal);
}

.category-dot.benefit,
.category-dot.birthSupport {
  background: var(--gold);
}

.category-dot.feeding {
  background: var(--coral);
}

.category-dot.shopping {
  background: #78952a;
}

.category-dot.care {
  background: #6656a4;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 118px;
  padding: 18px;
  border-radius: 8px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.15;
}

.calendar-section {
  overflow: hidden;
}

.calendar-heading {
  align-items: flex-start;
}

.calendar-actions,
.download-actions,
.share-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.icon-btn {
  width: 44px;
  padding: 0;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.calendar-card,
.month-panel {
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-card {
  padding: 18px;
}

.calendar-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.calendar-card-head h3 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 34px);
}

.calendar-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.calendar-meta strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.weekdays span {
  padding: 0 8px;
}

.weekdays span:first-child {
  color: var(--coral);
}

.month-grid {
  gap: 6px;
}

.day-cell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 126px;
  padding: 9px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 8px;
  background: #fff;
  cursor: default;
}

.day-cell[data-calendar-day-key] {
  cursor: pointer;
}

.day-cell[data-calendar-day-key]:focus-visible,
.day-pill:focus-visible,
.day-more:focus-visible {
  outline: 3px solid rgba(31, 124, 115, 0.24);
  outline-offset: 2px;
}

.day-cell.outside {
  background: #f0f3f0;
  color: #9aa5a8;
}

.day-cell.today {
  border-color: rgba(23, 107, 99, 0.45);
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.12);
}

.day-number {
  display: inline-grid;
  width: 30px;
  min-height: 28px;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.day-cell.today .day-number {
  background: var(--teal);
  color: #fff;
}

.day-items {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}

.day-pill,
.day-more {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-pill:hover,
.day-more:hover {
  filter: brightness(0.96);
}

.day-pill.done {
  opacity: 0.55;
  text-decoration: line-through;
}

.day-pill.checkup {
  background: var(--sky);
}

.day-pill.vaccine {
  background: var(--mint);
}

.day-pill.benefit {
  background: #fff1c9;
}

.day-pill.birthSupport {
  background: #ffe6d9;
}

.day-pill.feeding {
  background: var(--rose);
}

.day-pill.shopping {
  background: var(--leaf);
}

.day-pill.care {
  background: var(--lavender);
}

.day-more {
  color: var(--muted);
  background: #f2f5f4;
}

.calendar-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(23, 33, 38, 0.09);
  border-radius: 8px;
  background: #fbfcfb;
}

.calendar-detail-panel h4 {
  margin: 0;
  font-size: 16px;
}

.calendar-detail-panel > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.calendar-detail-list {
  display: grid;
  gap: 8px;
}

.calendar-detail-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 8px;
  background: #fff;
}

.calendar-detail-item span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.calendar-detail-item strong {
  color: var(--ink);
}

.calendar-detail-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.calendar-detail-item .calendar-detail-action {
  color: var(--ink);
  font-weight: 800;
}

.calendar-detail-item a {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.month-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  position: sticky;
  top: 82px;
}

.month-panel-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.month-panel-top strong {
  font-size: 24px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ef;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.month-focus-list {
  display: grid;
  gap: 10px;
}

.focus-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 8px;
  background: #fbfcfb;
}

.focus-item.done {
  opacity: 0.72;
}

.focus-item h3 {
  margin-top: 8px;
  font-size: 15px;
}

.focus-item p,
.download-note,
.focus-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

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

.download-actions .primary-btn,
.download-actions .ghost-btn {
  flex: 1 1 150px;
}

.section-block {
  margin: 20px 0;
  padding: clamp(20px, 4vw, 34px);
  border-radius: 8px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chip {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--muted);
}

.chip.active,
.chip:hover {
  border-color: transparent;
  background: var(--ink);
  color: white;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.event-card,
.benefit-card,
.tool-card,
.source-card,
.share-box {
  border: 1px solid rgba(31, 42, 46, 0.1);
  border-radius: 8px;
  background: #fff;
}

.event-card {
  display: grid;
  min-height: 300px;
  padding: 18px;
  gap: 14px;
}

.event-card.done {
  background: #f6f8f6;
}

.event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-badge,
.time-badge,
.risk-badge,
.tool-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.category-badge.checkup {
  background: var(--sky);
  color: var(--blue);
}

.category-badge.vaccine {
  background: var(--mint);
  color: var(--teal-dark);
}

.category-badge.benefit {
  background: #fff1c9;
  color: #7d5a0e;
}

.category-badge.birthSupport {
  background: #ffe6d9;
  color: #9e432d;
}

.category-badge.feeding {
  background: var(--rose);
  color: #9e432d;
}

.category-badge.shopping {
  background: #e9f2d7;
  color: #526b1f;
}

.category-badge.care {
  background: #e8e4f5;
  color: #57479d;
}

.time-badge.now {
  background: var(--ink);
  color: #fff;
}

.time-badge.upcoming {
  background: #f2f5f4;
  color: var(--teal-dark);
}

.time-badge.past {
  background: #f4eeee;
  color: #8a5d59;
}

.event-title {
  display: grid;
  gap: 8px;
}

.event-title h3 {
  min-height: 46px;
}

.date-window {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.event-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.level-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  background: #f2f5f4;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.item-list span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(31, 42, 46, 0.08);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.event-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.source-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.source-link:hover,
.ghost-link:hover {
  text-decoration: underline;
}

.task-toggle {
  width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.task-toggle[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 22px;
  align-items: start;
}

.section-copy {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.region-control {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid rgba(35, 124, 115, 0.18);
  border-radius: 8px;
  background: var(--mint);
}

.region-control label {
  font-size: 13px;
  font-weight: 900;
}

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

.region-control p {
  margin: 0;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.benefit-list {
  display: grid;
  gap: 12px;
}

.benefit-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
}

.benefit-card.highlight {
  border-color: rgba(35, 124, 115, 0.28);
  background: #f6fbf9;
}

.benefit-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.hospitals-section {
  display: grid;
  gap: 16px;
}

.emergency-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(217, 106, 78, 0.22);
  border-radius: 8px;
  background: #fff5f0;
}

.emergency-strip strong {
  color: #8b3424;
}

.emergency-strip span {
  color: var(--muted);
  line-height: 1.5;
}

.emergency-strip a {
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
}

.hospital-status {
  min-height: 22px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

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

.hospital-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 8px;
  background: #fff;
}

.hospital-card h3 {
  font-size: 17px;
}

.hospital-card dl {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hospital-card dt {
  color: var(--ink);
  font-weight: 900;
}

.hospital-card dd {
  margin: 0;
}

.hospital-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.hospital-links a {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1.38fr);
  gap: 16px;
  align-items: start;
}

.community-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 14px;
}

.category-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.category-chip.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.question-form,
.question-card {
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 8px;
  background: #fff;
}

.question-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  position: sticky;
  top: 82px;
}

.question-form label {
  font-size: 13px;
  font-weight: 900;
}

.question-form input,
.answer-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.question-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.question-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.question-body {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
}

.answer-list {
  display: grid;
  gap: 8px;
}

.answer-item {
  padding: 12px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 8px;
  background: #fbfcfb;
}

.answer-item.ai {
  border-color: rgba(23, 107, 99, 0.2);
  background: #f2faf7;
}

.answer-item span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.answer-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.answer-form {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(23, 33, 38, 0.08);
}

.risk-badge {
  background: #f2f5f4;
  color: var(--muted);
  white-space: nowrap;
}

.risk-badge.high {
  background: #fff1c9;
  color: #7d5a0e;
}

.risk-badge.now {
  background: var(--teal);
  color: #fff;
}

.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 38, 0.36);
}

.policy-modal[hidden] {
  display: none;
}

.policy-dialog {
  display: grid;
  width: min(420px, 100%);
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(23, 33, 38, 0.18);
}

.policy-dialog h3 {
  margin: 0;
}

.policy-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.doctor-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 35;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.34), transparent 28px),
    linear-gradient(145deg, #1f8278, var(--teal-dark));
  color: #fff;
  box-shadow:
    0 18px 34px rgba(15, 81, 75, 0.28),
    0 8px 16px rgba(23, 33, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  cursor: pointer;
  font-weight: 900;
  isolation: isolate;
  transform: translateY(0);
  animation: doctorFloat 3.8s ease-in-out infinite;
}

.doctor-fab::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border: 1px solid rgba(23, 107, 99, 0.24);
  border-radius: inherit;
  background: rgba(23, 107, 99, 0.08);
  animation: doctorPulse 2.4s ease-out infinite;
}

.doctor-fab::after {
  content: "질문";
  position: absolute;
  top: -7px;
  right: -4px;
  min-width: 36px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 16px rgba(217, 106, 78, 0.28);
  font-size: 11px;
  line-height: 1;
}

.doctor-fab:hover {
  box-shadow:
    0 24px 44px rgba(15, 81, 75, 0.34),
    0 10px 20px rgba(23, 33, 38, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.doctor-fab:focus-visible {
  outline: 3px solid rgba(217, 106, 78, 0.42);
  outline-offset: 5px;
}

.doctor-fab-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-bottom: 2px;
}

.doctor-fab-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doctor-fab-text {
  display: block;
  margin-top: -3px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

@keyframes doctorFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes doctorPulse {
  0% {
    opacity: 0.72;
    transform: scale(0.94);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .doctor-fab,
  .doctor-fab::before {
    animation: none;
  }
}

.doctor-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  z-index: 36;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(420px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 118px));
  overflow: hidden;
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 90px rgba(23, 33, 38, 0.24);
}

.doctor-panel[hidden] {
  display: none;
}

.doctor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(23, 33, 38, 0.08);
}

.doctor-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
  background: #fbfcfb;
}

.doctor-message {
  width: fit-content;
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.doctor-message.assistant {
  background: #eef7f4;
}

.doctor-message.user {
  justify-self: end;
  background: var(--teal);
  color: #fff;
}

.doctor-citations {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.doctor-citations a {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.doctor-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(23, 33, 38, 0.08);
}

.doctor-form textarea {
  min-height: 88px;
}

.doctor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.doctor-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.share-box {
  padding: 16px;
}

.share-presets {
  justify-content: flex-start;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 170px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  line-height: 1.55;
}

.share-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.copy-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.tool-grid,
.source-grid,
.hospital-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.enhanced-tools {
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.4fr) minmax(220px, 0.8fr);
}

.tool-card,
.source-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 18px;
}

.tool-card p,
.source-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.poop-colors,
.wave-bars,
.mini-calendar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.poop {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(31, 42, 46, 0.12);
  border-radius: 50%;
  cursor: pointer;
}

.poop.green {
  background: #799262;
}

.poop.mustard {
  background: #c59b42;
}

.poop.red {
  background: #c64036;
}

.poop.white {
  background: #f5f3e8;
}

.poop.black {
  background: #1f2324;
}

.wave-bars span {
  width: 10px;
  border-radius: 8px;
  background: var(--blue);
}

.wave-bars span:nth-child(1),
.wave-bars span:nth-child(5) {
  height: 20px;
}

.wave-bars span:nth-child(2),
.wave-bars span:nth-child(4) {
  height: 34px;
}

.wave-bars span:nth-child(3) {
  height: 44px;
  background: var(--coral);
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(4, 34px);
}

.mini-calendar span {
  height: 38px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 8px;
  background: var(--mint);
}

.mini-calendar span:nth-child(2) {
  background: var(--rose);
}

.mini-calendar span:nth-child(3) {
  background: var(--sky);
}

.tool-state {
  margin-top: auto;
  background: #f2f5f4;
  color: var(--teal-dark);
}

.audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-picker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.audio-tool audio {
  width: 100%;
}

.analysis-box {
  min-height: 120px;
  padding: 12px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.source-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.source-card {
  min-height: 190px;
}

.source-card a {
  align-self: end;
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
}

.source-card a:hover {
  text-decoration: underline;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 34px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .hero,
  .split-section,
  .calendar-layout,
  .community-layout {
    grid-template-columns: 1fr;
  }

  .month-panel,
  .question-form {
    position: static;
  }

  .summary-panel,
  .input-panel {
    min-height: auto;
  }

  .stats-grid,
  .event-grid,
  .tool-grid,
  .source-grid,
  .hospital-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 24px, 1180px);
    padding: 12px 0;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  main,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 20px;
  }

  .input-panel {
    padding: 22px;
  }

  h1 {
    font-size: 40px;
  }

  .lead {
    font-size: 15px;
  }

  .form-row,
  .region-fields,
  .stats-grid,
  .calendar-layout,
  .event-grid,
  .tool-grid,
  .source-grid,
  .hospital-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .calendar-card-head,
  .question-head,
  .emergency-strip,
  .benefit-card,
  .share-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .question-badges {
    justify-content: flex-start;
  }

  .calendar-actions,
  .calendar-meta {
    justify-content: flex-start;
    justify-items: start;
  }

  .calendar-card {
    overflow-x: auto;
  }

  .weekdays,
  .month-grid,
  .calendar-detail-panel {
    min-width: 760px;
  }

  .segmented {
    justify-content: flex-start;
  }

  .benefit-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .doctor-fab {
    right: 14px;
    bottom: 14px;
    width: 70px;
    height: 70px;
  }

  .doctor-fab-icon {
    width: 27px;
    height: 27px;
  }

  .doctor-fab-icon svg {
    width: 25px;
    height: 25px;
  }

  .doctor-fab-text {
    font-size: 11px;
  }

  .doctor-panel {
    right: 14px;
    bottom: 82px;
    width: calc(100vw - 28px);
    height: min(620px, calc(100vh - 96px));
  }
}
