:root {
  --navy: #0a245f;
  --navy-deep: #061942;
  --blue: #1746a2;
  --blue-soft: #eaf0fb;
  --green: #1e8e5a;
  --green-dark: #147247;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e9f2;
  --surface: #ffffff;
  --background: #f5f7fb;
  --radius: 24px;
  --shadow: 0 14px 34px rgba(20, 38, 78, .10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--background);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #ffca28; outline-offset: 3px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: #fff;
  background: rgba(6, 25, 66, .96);
  box-shadow: 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 760px);
  min-height: 74px;
  margin: auto;
  padding-top: env(safe-area-inset-top);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; }
.brand-copy span { margin-top: 3px; color: #c9d5f2; font-size: 12px; }

.install-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.1);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.install-button svg { width: 17px; height: 17px; }

main { width: min(100% - 32px, 760px); margin: auto; }
.app-tabs {
  position: sticky;
  z-index: 16;
  top: calc(74px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 0;
  background: rgba(245, 247, 251, .96);
  backdrop-filter: blur(12px);
}
.app-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fff;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.app-tab svg { width: 21px; height: 21px; fill: currentColor; }
.app-tab:last-child svg { fill: none; }
.app-tab.active { border-color: var(--navy); color: #fff; background: var(--navy); box-shadow: 0 8px 18px rgba(10, 36, 95, .18); }
.tab-panel { animation: tab-in .18s ease-out; }
.school-section { padding-top: 24px; }
.section { margin-bottom: 42px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 3px 16px; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-card {
  min-width: 0;
  padding: 20px 10px 18px;
  border: 1px solid rgba(10, 36, 95, .08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.quick-card h3 { margin: 0 0 13px; font-size: 17px; letter-spacing: -.03em; }
.duty-card { grid-column: 1 / -1; }
.big-call { display: flex; flex-direction: column; align-items: center; border-radius: 18px; }
.phone-circle {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #26a76e, #157a4d);
  box-shadow: 0 10px 22px rgba(30, 142, 90, .28), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .16s ease, box-shadow .16s ease;
}
.big-call:active .phone-circle { transform: scale(.94); box-shadow: 0 4px 12px rgba(30, 142, 90, .22); }
.phone-circle svg { width: 39px; height: 39px; fill: currentColor; }
.quick-number { margin-top: 13px; font-size: clamp(15px, 4.3vw, 19px); font-weight: 850; letter-spacing: -.03em; white-space: nowrap; }
.call-label { margin-top: 2px; color: var(--green-dark); font-size: 12px; font-weight: 800; }
.school-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.school-card { display: flex; flex-direction: column; padding: 18px 7px 12px; }
.school-card h3 { min-height: 48px; margin-bottom: 8px; display: grid; place-items: center; }
.school-card .big-call { flex: 1; }
.school-card .phone-circle { width: 72px; height: 72px; }
.school-card .phone-circle svg { width: 37px; height: 37px; }
.school-card .quick-number { font-size: clamp(12px, 3.45vw, 17px); }
.school-card .more-button { width: 100%; min-height: 36px; margin-top: 10px; padding: 0 5px; font-size: 11px; }
.more-button {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.more-button svg { width: 18px; height: 18px; fill: currentColor; }

.fax-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fax-item { display: grid; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; cursor: pointer; }
.fax-item span { font-size: 13px; font-weight: 800; }
.fax-item strong { font-size: 15px; letter-spacing: -.025em; }
.fax-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.notice { margin: -13px 0 38px; color: var(--muted); font-size: 11px; text-align: center; }

footer { display: grid; justify-items: center; padding: 27px 16px calc(38px + env(safe-area-inset-bottom)); color: #8090b5; background: var(--navy-deep); font-size: 12px; }
footer img { width: 48px; height: 48px; padding: 3px; border-radius: 50%; background: #fff; object-fit: contain; opacity: .82; }
footer p { margin: 8px 0 0; }

.sheet-backdrop { position: fixed; z-index: 50; inset: 0; background: rgba(4, 13, 34, .58); backdrop-filter: blur(3px); }
.number-sheet, .install-sheet {
  position: fixed;
  z-index: 51;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 620px);
  max-height: min(78vh, 720px);
  margin: auto;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(4,13,34,.18);
}
.sheet-handle { width: 44px; height: 5px; margin: 2px auto 18px; border-radius: 99px; background: #d7dce5; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.sheet-heading span { color: var(--muted); font-size: 12px; }
.sheet-heading h2 { margin: 1px 0 0; font-size: 23px; letter-spacing: -.035em; }
.close-button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: #f0f2f6; cursor: pointer; }
.close-button svg { width: 23px; height: 23px; }
.number-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.number-option { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 15px; color: var(--navy); background: #fff; font-size: 14px; font-weight: 800; }
.number-option svg { flex: 0 0 22px; width: 22px; height: 22px; fill: var(--green); }
.number-option-copy { display: grid; min-width: 0; line-height: 1.3; }
.number-option-copy strong { font-size: 14px; }
.number-option-copy small { color: var(--muted); font-size: 12px; font-weight: 700; }
.meal-panel { min-height: 68vh; padding: 24px 0 42px; }
.meal-page-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 15px; }
.meal-page-heading span { color: var(--blue); font-size: 13px; font-weight: 800; }
.meal-page-heading h2 { margin: 2px 0 0; color: var(--navy-deep); font-size: 27px; letter-spacing: -.04em; }
.meal-refresh { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--blue); background: #fff; cursor: pointer; }
.meal-refresh svg { width: 21px; height: 21px; }
.meal-date-controls { display: grid; grid-template-columns: 1fr minmax(138px, 1.25fr) 1fr; gap: 7px; margin: 0 0 9px; }
.meal-date-button, .meal-date-input { min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 13px; color: var(--navy); background: #fff; font: inherit; font-size: 13px; font-weight: 800; }
.meal-date-button { display: flex; align-items: center; justify-content: center; gap: 3px; padding: 0 8px; cursor: pointer; }
.meal-date-button svg { width: 17px; height: 17px; }
.meal-date-button.previous svg { transform: rotate(180deg); }
.meal-date-input { width: 100%; padding: 0 9px; color-scheme: light; text-align: center; cursor: pointer; }
.meal-today-button { min-height: 38px; margin: 0 auto 10px; padding: 0 14px; border: 0; border-radius: 999px; color: var(--blue); background: #eaf1ff; font-size: 12px; font-weight: 850; cursor: pointer; }
.meal-page-body { padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.meal-loading { display: grid; justify-items: center; gap: 9px; padding: 34px 10px; color: var(--muted); font-size: 13px; }
.meal-loading p { margin: 0; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid #dbe3f3; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.meal-content { display: grid; gap: 10px; }
.meal-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.meal-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.meal-card-heading h3 { margin: 0; color: var(--navy); font-size: 17px; }
.meal-card-heading span { padding: 4px 8px; border-radius: 999px; color: var(--green-dark); background: #e9f7f0; font-size: 11px; font-weight: 800; }
.meal-dishes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.meal-dishes li { padding: 6px 9px; border-radius: 9px; color: #344054; background: var(--background); font-size: 13px; }
.meal-empty { margin: 0; padding: 30px 15px; border-radius: 16px; color: var(--muted); background: var(--background); text-align: center; font-size: 14px; }
.meal-error { display: grid; justify-items: center; gap: 12px; padding: 27px 15px; border-radius: 16px; color: var(--muted); background: var(--background); text-align: center; }
.meal-error p { margin: 0; font-size: 13px; }
.meal-error button { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px; color: #fff; background: var(--blue); font-size: 13px; font-weight: 800; cursor: pointer; }
.meal-error button svg { width: 18px; height: 18px; }
.meal-source { margin: 14px 0 0; color: #98a2b3; font-size: 10px; text-align: center; }
.install-guide { display: grid; gap: 12px; }
.ios-install-notice { display: grid; gap: 3px; padding: 15px; border: 1px solid #cbd9f5; border-radius: 16px; color: var(--navy); background: #edf3ff; }
.ios-install-notice strong { font-size: 15px; }
.ios-install-notice span { color: #51678f; font-size: 12px; }
.install-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.install-steps li { display: grid; grid-template-columns: 32px 1fr; align-items: start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.step-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: 13px; font-weight: 850; }
.install-steps li > span:last-child { display: grid; gap: 3px; }
.install-steps strong { color: var(--navy); font-size: 14px; }
.install-steps small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.share-chip { display: inline-grid; width: 27px; height: 27px; margin-left: 3px; place-items: center; border: 1px solid #bfd0f1; border-radius: 8px; color: #1261d7; background: #fff; vertical-align: middle; }
.share-chip svg { width: 18px; height: 18px; }
.android-install-help { margin: 0; padding: 13px 15px; border-radius: 14px; color: var(--muted); background: var(--background); font-size: 12px; }
.android-install-help strong { color: var(--navy); font-size: 13px; }

[hidden] { display: none !important; }
body.sheet-open { overflow: hidden; }
.toast { position: fixed; z-index: 80; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); left: 20px; width: max-content; max-width: calc(100% - 40px); margin: auto; padding: 12px 17px; border-radius: 999px; color: #fff; background: #182230; box-shadow: 0 10px 24px rgba(0,0,0,.18); font-size: 13px; font-weight: 750; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tab-in { from { opacity: 0; transform: translateY(4px); } }

@media (min-width: 640px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .duty-card { grid-column: auto; }
}

@media (max-width: 380px) {
  .header-inner, main { width: min(100% - 24px, 760px); }
  .install-button span { display: none; }
  .install-button { width: 40px; padding: 0; justify-content: center; }
  .app-tab { font-size: 13px; }
  .quick-card { padding-inline: 7px; }
  .quick-grid .phone-circle { width: 68px; height: 68px; }
  .quick-grid .phone-circle svg { width: 35px; height: 35px; }
  .school-grid { gap: 7px; }
  .school-card { padding-inline: 4px; }
  .school-card .phone-circle { width: 64px; height: 64px; }
  .school-card .phone-circle svg { width: 33px; height: 33px; }
  .school-card .quick-number { font-size: 11px; }
  .number-list { grid-template-columns: 1fr; }
  .meal-date-controls { grid-template-columns: 1fr minmax(125px, 1.2fr) 1fr; gap: 5px; }
  .meal-date-button { padding-inline: 5px; font-size: 12px; }
  .meal-date-input { padding-inline: 5px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
