*
{
  box-sizing: border-box;
}

:root
{
  --bg: #f0f4fa;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #dce6f5;
  --line-strong: #c8d9f0;
  --text: #1a2540;
  --sub: #7a8fa8;
  --sub-2: #5c7490;
  --brand-blue: #426CB5;
  --brand-blue-dark: #2f5099;
  --brand-blue-soft: #e8eef9;
  --brand-blue-mid: #d0dcf5;
  --brand-yellow: #E9C84B;
  --brand-yellow-dark: #c9a830;
  --brand-yellow-soft: #fdf8e3;
  --brand-yellow-mid: #f5e9b0;
  --purple: #7b61ff;
  --purple-soft: #f4f1ff;
  --purple-mid: #d1c4e9;
  --purple-dark: #4527a0;
  --teal: #00b8d4;
  --teal-soft: #e0f7fa;
  --teal-mid: #b2ebf2;
  --teal-dark: #00838f;
  --pink: #e91e8c;
  --pink-soft: #fce4f3;
  --pink-mid: #f8bbd0;
  --pink-dark: #ad1457;
  --gray: #8b95a1;
  --gray-soft: #f2f4f6;
  --gray-mid: #d1d6db;
  --gray-dark: #333d4b;
  --shadow-card: 0 1px 2px rgba(66, 108, 181, 0.04), 0 6px 20px rgba(66, 108, 181, 0.07);
  --radius-xxl: 28px;
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 14px;
}

body
{
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #eef3fb;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Layout ── */

.wrap
{
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 18px 56px;
}

.header-bg
{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 340px;
  background: linear-gradient(160deg, var(--brand-blue) 0%, #3058a0 100%);
  z-index: 0;
  overflow: hidden;
}

.header-bg::before
{
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(233, 200, 75, 0.20);
}

.header-bg::after
{
  content: '';
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

/* ── Content Grid (PC 2-column) ── */

.content-grid
{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Brand Header ── */

.brand
{
  padding: 6px 2px 32px;
}

.brand-badge
{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.30);
}

.brand h1
{
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -1.1px;
  color: #ffffff;
}

.brand h1 span
{
  color: var(--brand-yellow);
}

.brand p
{
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* ── Section / Card ── */

.section
{
  margin-bottom: 0;
}

.card
{
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xxl);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}

.section-title
{
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.7px;
  white-space: nowrap;
}

.section-sub
{
  margin: 4px 0 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Dose Grid ── */

@keyframes pulse
{
  0%, 100%
  {
    opacity: 1;
    transform: scale(1);
  }
  50%
  {
    opacity: 0.5;
    transform: scale(0.75);
  }
}

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

.dose-card
{
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 16px 16px;
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .15s ease;
}

.dose-card.active
{
  border: 1.5px solid var(--brand-blue);
  background: var(--surface-soft);
}

.dose-top
{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.pill
{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}

.p-25  { background: var(--gray-mid); color: var(--gray-dark); }
.p-50  { background: var(--purple-mid); color: var(--purple-dark); }
.p-75  { background: var(--teal-mid); color: var(--teal-dark); }
.p-100 { background: var(--pink-mid); color: var(--pink-dark); }
.p-125 { background: #ffe0b2; color: #e65100; }
.p-150 { background: #c8e6c9; color: #1b5e20; }

.wait-label
{
  font-size: 13px;
  color: var(--sub);
  font-weight: 700;
  margin-bottom: 8px;
}

.wait
{
  display: flex;
  align-items: flex-end;
  gap: 6px;
  line-height: 1;
}

.wait .num
{
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -2.3px;
  color: #1B1F27;
}

.wait .txt
{
  font-size: 15px;
  color: #1B1F27;
  font-weight: 700;
  padding-bottom: 8px;
}

.bar
{
  height: 6px;
  background: var(--brand-blue-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.bar > span
{
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue) 0%, #5a8fd8 100%);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}

.tiny-note
{
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.55;
  font-weight: 600;
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Lookup Section ── */

.pane-title
{
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.8px;
  white-space: nowrap;
}

.pane-sub
{
  margin: 0 0 22px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.field
{
  margin-bottom: 16px;
}

.field label
{
  display: block;
  margin-bottom: 9px;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.input
{
  width: 100%;
  height: 54px;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input::placeholder
{
  color: #b0bcc8;
}

.input:focus
{
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(66, 108, 181, 0.10);
}

.btn
{
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  cursor: pointer;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(66, 108, 181, 0.28);
}

.btn:hover
{
  background: var(--brand-blue-dark);
  box-shadow: 0 6px 20px rgba(66, 108, 181, 0.35);
}

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

/* ── Lookup Result ── */

.lookup-result-wrap
{
  margin-top: 20px;
  background: #f2f5f9;
  border-radius: 20px;
  padding: 16px;
  border: 1px solid #e2e8f2;
}

.lookup-name-row
{
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--brand-blue-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-blue-mid);
}

.lookup-name
{
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.7px;
  color: var(--brand-blue);
}

.lookup-birth
{
  font-size: 14px;
  font-weight: 600;
  color: var(--sub-2);
}

.booking-block
{
  background: #ffffff;
  border: 1px solid #dce6f5;
  border-radius: 16px;
  padding: 14px 16px;
  position: relative;
}

.booking-status-badge
{
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.booking-status-badge.s-waiting { background: #fff0f0; color: #e53935; }
.booking-status-badge.s-partial { background: #fefce8; color: #ca8a04; }
.booking-status-badge.s-ready   { background: #e8f8f0; color: #1a9c55; }
.booking-status-badge.s-done    { background: #f2f4f6; color: #8b95a1; }

.booking-rank
{
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf1f8;
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
}

.booking-rank.done
{
  color: #8b95a1;
}

.no-result
{
  margin-top: 18px;
  padding: 22px 16px;
  border-radius: 18px;
  background: var(--brand-blue-soft);
  border: 1px solid var(--brand-blue-mid);
  text-align: center;
}

.no-result p
{
  margin: 0;
  color: var(--sub-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

/* ── Card Color Headers ── */

.card-header-blue
{
  margin: -24px -20px 22px;
  padding: 16px 18px;
  background: var(--brand-blue);
  border-radius: 28px 28px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-header-blue .section-title
{
  color: #fff;
  margin: 0;
  font-size: 16px;
}

.card-header-blue .section-sub
{
  color: rgba(255, 255, 255, 0.72);
  margin: 4px 0 0;
  font-size: 11px;
}

.live-chip-white
{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.live-chip-white .dot
{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-yellow);
  animation: pulse 1.8s ease-in-out infinite;
  display: inline-block;
}

.card-header-yellow
{
  margin: -24px -20px 22px;
  padding: 18px 22px;
  background: var(--brand-yellow);
  border-radius: 28px 28px 0 0;
}

.card-header-yellow .pane-title
{
  color: #3a2800;
  margin: 0 0 4px;
}

.card-header-yellow .pane-sub
{
  color: rgba(58, 40, 0, 0.65);
  margin: 0;
}

/* ── Refresh Button ── */

#refreshBtn
{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

#refreshBtn:active
{
  opacity: .7;
}

#refreshIcon
{
  display: inline-block;
  line-height: 1;
}

#refreshIcon.spinning
{
  animation: spin .6s linear;
}

@keyframes spin
{
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Footer ── */

.page-footer
{
  margin-top: 32px;
  text-align: center;
}

.page-footer p
{
  margin: 0;
  font-size: 12px;
  color: var(--sub);
  font-weight: 500;
}

/* ── Dose Badge (inline) ── */
.dose-badge
{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  vertical-align: middle;
}

.dose-badge.db-25  { background: #d1d6db; color: #333d4b; }
.dose-badge.db-50  { background: #d1c4e9; color: #4527a0; }
.dose-badge.db-75  { background: #b2ebf2; color: #00838f; }
.dose-badge.db-100 { background: #f8bbd0; color: #ad1457; }
.dose-badge.db-125 { background: #ffe0b2; color: #e65100; }
.dose-badge.db-150 { background: #c8e6c9; color: #1b5e20; }

.drug-status-tag
{
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.booking-status-badge
{
  font-size: 13px;
}

.lookup-info-box
{
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 600;
}

.lookup-info-box.ready
{
  background: #e8f8f0;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.lookup-info-box.waiting
{
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.lookup-info-box.done
{
  background: #f2f4f6;
  color: #8b95a1;
  border: 1px solid #e5e7eb;
  text-align: center;
  font-weight: 700;
}

.reserve-toast
{
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2540;
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform .3s ease;
  z-index: 999;
  white-space: nowrap;
}

.reserve-toast.show
{
  transform: translateX(-50%) translateY(0);
}

.hidden
{
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   Responsive
══════════════════════════════════════════════════════════════ */

/* Mobile small */
@media (max-width: 390px)
{
  .wrap
  {
    padding: 22px 14px 40px;
  }

  .brand h1
  {
    font-size: 27px;
  }

  .section-title,
  .pane-title
  {
    font-size: 20px;
  }

  .wait .num
  {
    font-size: 46px;
  }
}

/* Small mobile */
@media (max-width: 350px)
{
  .section-title,
  .card-header-blue .section-title
  {
    font-size: 14px;
  }

  .section-sub,
  .card-header-blue .section-sub
  {
    font-size: 10px;
  }

  .wait .num
  {
    font-size: 40px;
  }

  .brand h1
  {
    font-size: 24px;
  }
}
