:root {
  --paper: #f4f1e9;
  --surface: #fffefb;
  --ink: #253028;
  --muted: #6e776f;
  --line: #dcded4;
  --forest: #244d3f;
  --green: #2f6655;
  --green-soft: #e5f0ea;
  --clay: #bd684b;
  --clay-soft: #f8e7df;
  --sand: #eee7d8;
  --shadow: 0 18px 48px rgba(42, 53, 45, 0.09);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: #e8e9e4; scroll-behavior: smooth; }
body { margin: 0; background: #e8e9e4; line-height: 1.45; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(47, 102, 85, 0.34); outline-offset: 3px; }
button:disabled { cursor: wait; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--forest); text-decoration: none; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { width: min(100%, 920px); min-height: 100dvh; margin: 0 auto; padding: env(safe-area-inset-top) 24px calc(30px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 92% 0, #f2dbc8 0, transparent 27rem), radial-gradient(circle at 5% 13%, #dce9df 0, transparent 24rem), var(--paper); box-shadow: 0 0 46px rgba(20, 30, 24, 0.08); }
.brand-bar { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: var(--forest); font-size: 12px; font-weight: 900; box-shadow: 0 8px 20px rgba(36, 77, 63, 0.2); }
.brand small, .brand strong { display: block; }
.brand small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.13em; }
.brand strong { margin-top: 1px; font-size: 15px; }
.refresh-button { display: flex; min-height: 44px; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); background: rgba(255, 254, 251, 0.82); font-size: 12px; font-weight: 850; cursor: pointer; }
.refresh-button > span:first-child { font-size: 19px; line-height: 1; }
.refresh-button.loading > span:first-child { animation: spin 0.8s linear infinite; }

.hero { position: relative; min-height: 286px; margin: 10px 0 18px; overflow: hidden; border-radius: 28px; background: linear-gradient(145deg, #315f50, #1e3c32 68%); box-shadow: 0 22px 48px rgba(33, 65, 53, 0.19); }
.hero::before { position: absolute; inset: 0; opacity: 0.16; background: repeating-linear-gradient(112deg, transparent 0 17px, rgba(255,255,255,.2) 18px); content: ""; }
.hero-copy { position: relative; z-index: 2; padding: 54px 40px; color: #fff; }
.hero-copy p { margin: 0 0 10px; color: #d8e8df; font-size: 11px; font-weight: 850; letter-spacing: 0.08em; }
.hero-copy h1 { margin: 0; font-size: clamp(34px, 6vw, 54px); letter-spacing: -0.065em; line-height: 1.08; }
.hero-copy > span { display: block; margin-top: 17px; color: rgba(255,255,255,.77); font-size: 13px; }
.hero-art { position: absolute; right: -26px; bottom: -54px; display: grid; width: 250px; height: 250px; place-items: center; border-radius: 50%; color: rgba(255,255,255,.86); background: #c57a5c; font-family: Georgia, serif; font-size: 90px; transform: rotate(-8deg); }

.call-panel { display: grid; grid-template-columns: 1fr 1.35fr; gap: 22px; align-items: center; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,254,251,.91); box-shadow: var(--shadow); }
.call-panel p, .section-heading p { margin: 0 0 4px; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.call-panel h2 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.call-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.call-actions a { display: flex; min-height: 62px; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 15px; color: #fff; background: var(--forest); text-decoration: none; }
.call-actions a > span:first-child { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: rgba(255,255,255,.13); font-size: 17px; }
.call-actions small, .call-actions strong { display: block; white-space: nowrap; }
.call-actions small { color: rgba(255,255,255,.7); font-size: 9px; }
.call-actions strong { margin-top: 2px; font-size: 13px; }
.guide { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin: 13px 0 34px; padding: 13px 15px; border: 1px solid #d9d0be; border-radius: 14px; color: #655e50; background: #f4ecdc; }
.guide > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #fff; background: #9f8355; font-family: Georgia, serif; font-weight: 900; }
.guide p { margin: 2px 0 0; font-size: 11px; line-height: 1.6; }

.schedule-section { scroll-margin-top: 15px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 3px 16px; }
.section-heading h2 { margin: 0; font-size: 28px; letter-spacing: -.055em; }
.section-heading > span { padding: 7px 10px; border-radius: 999px; color: var(--muted); background: #eae8e0; font-size: 11px; font-weight: 750; white-space: nowrap; }
.offline-banner { margin-bottom: 10px; padding: 11px 13px; border-radius: 11px; color: #765327; background: #f7e6c7; font-size: 11px; font-weight: 750; }
.status-panel { display: grid; min-height: 220px; place-content: center; justify-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 22px; color: var(--muted); background: var(--surface); }
.status-panel.error { padding: 28px; color: var(--ink); text-align: center; }
.status-panel p { max-width: 350px; margin: 0; color: var(--muted); font-size: 12px; }
.status-panel button { min-height: 44px; margin-top: 5px; padding: 10px 16px; border: 0; border-radius: 11px; color: #fff; background: var(--green); font-weight: 850; cursor: pointer; }
.spinner { width: 30px; height: 30px; border: 3px solid #dce7e0; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.schedule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.day-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 30px rgba(42, 53, 45, .055); }
.day-card.today { border-color: #a9c3b5; box-shadow: 0 0 0 2px rgba(47, 102, 85, .08), 0 10px 30px rgba(42, 53, 45, .055); }
.day-card.weekend .day-number { color: var(--clay); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 18px 13px; border-bottom: 1px solid #e7e6df; }
.day-date { display: flex; align-items: center; gap: 10px; }
.day-number { font-family: Georgia, "Times New Roman", serif; font-size: 35px; line-height: 1; }
.day-date span { display: grid; gap: 2px; }
.day-date strong { font-size: 13px; }
.day-date small { color: var(--muted); font-size: 10px; }
.day-badge { padding: 5px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 900; }
.slot-list { display: grid; padding: 7px 12px 12px; }
.slot-row { display: grid; min-height: 66px; grid-template-columns: minmax(102px, .9fr) minmax(0, 1.1fr); align-items: center; gap: 10px; border-top: 1px solid #ecebe6; }
.slot-row:first-child { border-top: 0; }
.slot-time { display: grid; gap: 2px; }
.slot-time strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.slot-time small { color: var(--muted); font-size: 9px; }
.book-button, .cancel-button { min-height: 44px; padding: 9px 10px; border-radius: 11px; font-size: 11px; font-weight: 900; cursor: pointer; }
.book-button { border: 1px solid #b8d0c4; color: var(--green); background: var(--green-soft); }
.book-button:disabled { border-color: #dedfd9; color: #969b95; background: #efefeb; cursor: not-allowed; opacity: 1; }
.reserved { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 7px; padding: 7px 8px 7px 11px; border-radius: 12px; background: #f0eee7; }
.reserved > span { min-width: 0; }
.reserved small, .reserved strong { display: block; }
.reserved small { color: var(--muted); font-size: 8px; }
.reserved strong { overflow: hidden; margin-top: 1px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cancel-button { flex: 0 0 auto; border: 0; color: #a14c3f; background: var(--clay-soft); }

footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 26px; padding: 18px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; }
footer p { margin: 0; }

.dialog-backdrop { position: fixed; z-index: 50; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 24px 18px 0; background: rgba(20, 29, 24, .5); backdrop-filter: blur(4px); }
.dialog-sheet { position: relative; width: min(100%, 480px); max-height: calc(100dvh - 35px); overflow-y: auto; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; background: #fffefb; box-shadow: 0 -20px 60px rgba(20, 29, 24, .22); }
.dialog-sheet.compact { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.sheet-handle { display: block; width: 42px; height: 4px; margin: 0 auto 18px; border-radius: 5px; background: #d2d3cc; }
.dialog-close { position: absolute; top: 13px; right: 17px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; color: var(--muted); background: transparent; font-size: 28px; cursor: pointer; }
.dialog-kicker { margin: 0 0 4px; color: var(--green); font-size: 9px; font-weight: 950; letter-spacing: .1em; }
.dialog-kicker.danger { color: #a14c3f; }
.dialog-sheet h2 { margin: 0; font-size: 25px; letter-spacing: -.05em; }
.dialog-sheet > p:not(.dialog-kicker) { margin: 6px 0 16px; color: var(--muted); font-size: 11px; }
.selected-slot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; padding: 14px; border-radius: 14px; background: #f0f2ed; }
.selected-slot span { color: var(--muted); font-size: 11px; }
.selected-slot strong { font-size: 14px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; font-size: 11px; font-weight: 900; }
.family-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.family-options label { position: relative; }
.family-options input { position: absolute; opacity: 0; pointer-events: none; }
.family-options span { display: grid; min-height: 48px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 12px; font-weight: 850; cursor: pointer; }
.family-options input:checked + span { border-color: var(--green); color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.family-options input:focus-visible + span { outline: 3px solid rgba(47, 102, 85, .34); outline-offset: 2px; }
.primary-button, .secondary-button, .danger-button { min-height: 48px; border-radius: 12px; font-weight: 900; cursor: pointer; }
.primary-button { width: 100%; margin-top: 18px; border: 0; color: #fff; background: var(--green); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #f2f1eb; }
.danger-button { border: 0; color: #fff; background: #a75043; }
.primary-button:disabled, .danger-button:disabled { opacity: .58; }
.toast { position: fixed; z-index: 70; right: 50%; bottom: max(20px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; color: #fff; background: rgba(30, 43, 35, .96); box-shadow: 0 12px 32px rgba(0,0,0,.2); font-size: 11px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(50%, 12px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(50%, 0); }
body.dialog-open { overflow: hidden; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .app-shell { padding-right: 16px; padding-left: 16px; }
  .hero { min-height: 270px; }
  .hero-copy { padding: 47px 25px; }
  .hero-art { right: -80px; opacity: .8; }
  .call-panel { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .schedule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .refresh-text { display: none; }
  .refresh-button { width: 44px; justify-content: center; padding: 0; }
  .hero { min-height: 252px; border-radius: 23px; }
  .hero-copy { padding: 42px 21px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-copy > span { max-width: 225px; font-size: 11px; }
  .call-actions { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 25px; }
  .section-heading > span { margin-top: 4px; }
  .day-head { padding-inline: 15px; }
  .slot-list { padding-inline: 10px; }
  .family-options { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
