* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root {
  --red: #a5161d;
  --red-dark: #781017;
  --ink: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f5f7fa;
  --shadow: 0 16px 42px rgba(16, 24, 40, .08);
  --shadow-hover: 0 14px 30px rgba(16, 24, 40, .13);
  --content: 1240px;
}
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topin { max-width: var(--content); margin: auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brandLogo { width: 68px; height: 68px; flex: 0 0 68px; border-radius: 50%; background: #fff url("changwon-fire-headquarters-logo.png") center / cover no-repeat; box-shadow: 0 4px 12px rgba(16, 24, 40, .12), inset 0 0 0 1px rgba(16, 24, 40, .08); }
.brand strong { display: block; font-size: 18px; }
.brand small { display: block; color: var(--muted); font-size: 11px; }

.btn, .icon, .x, .todayItem, .event {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn { border: 0; border-radius: 11px; padding: 10px 14px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover, .icon:hover, .x:hover { transform: translateY(-2px); box-shadow: 0 7px 16px rgba(16, 24, 40, .12); }
.btn:active, .icon:active, .x:active { transform: translateY(0) scale(.97); }
.primary { background: var(--red); color: #fff; }
.primary:hover { background: #8f1218; }
.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.light:hover { border-color: #b9c0ca; background: #f9fafb; }
.danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.danger:hover { background: #ffe4e6; }
.master { background: #263a58; color: #fff; }
.master:hover { background: #1d2c43; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(165, 22, 29, .28); outline-offset: 2px; }

.status { max-width: var(--content); margin: auto; padding: 10px 18px 0; display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; transition: background-color .2s ease, box-shadow .2s ease; }
.sdot.ok { background: #12b76a; box-shadow: 0 0 0 4px rgba(18, 183, 106, .12); }
.sdot.bad { background: #f04438; }
.sdot.sync { background: #f79009; animation: pulse 1.1s ease-in-out infinite; }
.banner { max-width: var(--content); margin: 12px auto 0; padding: 0 18px; }
.banner > div { padding: 13px 14px; border-radius: 13px; background: #fff1f2; border: 1px solid #fecdd3; color: #881337; font-size: 12px; }

.hero { max-width: var(--content); margin: auto; padding: 25px 18px 20px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr); align-items: stretch; gap: 20px; }
.heroMain { min-height: 270px; padding: 40px 44px; border-radius: 25px; color: #fff; background: linear-gradient(125deg, var(--red-dark), #be1f25); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; }
.kicker { font-size: 11px; font-weight: 900; letter-spacing: .13em; opacity: .8; }
.hero h1 { max-width: 680px; font-size: clamp(40px, 4.4vw, 58px); line-height: 1.14; letter-spacing: -.035em; margin: 14px 0 0; text-wrap: balance; }
.heroBtns { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 31px; }
.heroBtns .primary { background: #fff; color: var(--red); }
.heroBtns .primary:hover { background: #fff7f7; }
.contact { min-height: 270px; background: #fff; border: 1px solid var(--line); border-radius: 25px; padding: 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; gap: 23px; transition: transform .22s ease, box-shadow .22s ease; }
.contact:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.contact small { color: var(--muted); font-weight: 800; }
.contactHead { display: grid; gap: 11px; }
.contactPerson { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.contactPerson strong { font-size: 22px; }
.contactPerson span { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #fff1f2; color: var(--red); font-size: 12px; font-weight: 900; }
.contact p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.wrap { max-width: var(--content); margin: auto; padding: 0 18px 44px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 19px; }
.calPanel { padding: 19px; }
.calHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calHead h2 { margin: 0; font-size: 20px; }
.icon { width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { text-align: center; color: var(--muted); font-size: 11px; font-weight: 900; padding: 6px; }
.dow.sunday, .day.sunday .daynum { color: #b42318; }
.dow.saturday, .day.saturday .daynum { color: #175cd3; }
.day { min-height: 111px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease; }
.day.clickable:hover { transform: translateY(-3px); border-color: rgba(165, 22, 29, .45); background: #fffafa; box-shadow: 0 10px 22px rgba(111, 20, 26, .12); }
.day.clickable:active { transform: translateY(-1px); }
.day.muted { opacity: .34; background: #fafafa; }
.day.today { outline: 2px solid rgba(165, 22, 29, .35); background: #fffafa; }
.daynum { font-size: 11px; font-weight: 900; margin-bottom: 6px; }
.event { width: 100%; border: 0; border-radius: 8px; padding: 6px 7px; margin: 3px 0; text-align: left; font-size: 10px; font-weight: 900; }
.event:hover { transform: translateX(2px); filter: saturate(1.12); box-shadow: 0 3px 9px rgba(16, 24, 40, .12); }
.event[data-dept="소방행정과"] { background: #fee2e2; color: #991b1b; }
.event[data-dept="안전예방과"] { background: #ffedd5; color: #9a3412; }
.event[data-dept="대응총괄과"] { background: #dcfce7; color: #166534; }
.event[data-dept="현장대응단"] { background: #dbeafe; color: #1e40af; }
.event[data-dept="CCTV관제센터"] { background: #ede9fe; color: #5b21b6; }
.event[data-dept="기타"] { background: #f2f4f7; color: #344054; }
.more { font-size: 10px; color: var(--muted); }

.side { display: flex; flex-direction: column; gap: 16px; }
.sideCard { padding: 20px; transition: box-shadow .2s ease, transform .2s ease; }
.sideCard:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(16, 24, 40, .07); }
.sideCard h3 { margin: 0 0 12px; }
.todayItem { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px; margin-bottom: 7px; }
.todayItem:hover { transform: translateX(3px); border-color: rgba(165, 22, 29, .35); background: #fffafa; }
.time { color: var(--red); font-size: 11px; font-weight: 900; }
.dept { font-size: 13px; font-weight: 900; margin: 4px 0; }
.purpose { font-size: 11px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); font-size: 12px; padding: 23px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.leg { display: flex; gap: 8px; align-items: center; color: #475467; font-size: 11px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.a { background: #dc2626; }
.b { background: #f97316; }
.c { background: #16a34a; }
.d { background: #2563eb; }
.e { background: #7c3aed; }
.f { background: #667085; }
.usageGuide { color: #475467; font-size: 11px; line-height: 1.65; }
.usageGuide > strong { display: block; color: var(--ink); font-size: 14px; }
.noticeList { list-style: none; display: grid; gap: 10px; margin: 12px 0 0; padding: 0; }
.noticeList li { position: relative; padding-left: 15px; }
.noticeList li::before { content: ""; position: absolute; left: 0; top: .78em; width: 6px; height: 6px; border-radius: 50%; background: var(--red); transform: translateY(-50%); opacity: .78; }

.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 0 18px 27px; line-height: 1.8; }
.footer small { display: block; font-size: 10px; color: #98a2b3; }

.modalBg { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .56); display: none; align-items: center; justify-content: center; padding: 15px; backdrop-filter: blur(3px); }
.modalBg.show { display: flex; animation: fadeIn .18s ease-out; }
.modal { width: min(620px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.modalBg.show .modal { animation: modalIn .22s ease-out; }
.mhead { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.mhead h3 { margin: 0; }
.x { width: 33px; height: 33px; border: 0; border-radius: 9px; background: #f2f4f7; }
.mbody { padding: 19px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.full { grid-column: 1 / -1; }
label { font-size: 11px; font-weight: 900; }
input, select, textarea { width: 100%; border: 1px solid #d0d5dd; border-radius: 10px; padding: 10px 11px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.pinMask { -webkit-text-security: disc; }
input:hover, select:hover, textarea:hover { border-color: #98a2b3; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(165, 22, 29, .08); }
textarea { min-height: 82px; }
.help { color: var(--muted); font-size: 10px; }
.mact { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.details { display: grid; gap: 10px; }
.drow { display: grid; grid-template-columns: 100px 1fr; gap: 10px; font-size: 12px; }
.drow span:first-child { color: var(--muted); }
.cancelBox { margin-top: 17px; padding: 13px; border: 1px solid #fee2e2; background: #fff8f8; border-radius: 12px; }
.masterBox { border-color: #d6deeb; background: #f6f8fb; }
.toast { position: fixed; right: 17px; bottom: 17px; z-index: 220; background: #101828; color: #fff; padding: 11px 13px; border-radius: 10px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; box-shadow: 0 12px 28px rgba(16, 24, 40, .24); }
.toast.show { opacity: 1; transform: translateY(0); }
.loader { position: fixed; inset: 0; z-index: 250; background: rgba(255, 255, 255, .46); display: none; place-items: center; }
.loader.show { display: grid; }
.spin { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #f1b7ba; border-top-color: var(--red); animation: spin .7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.82); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .heroMain, .contact { min-height: auto; }
  .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .topin { padding: 9px 11px; }
  .brand { gap: 10px; }
  .brandLogo { width: 54px; height: 54px; flex-basis: 54px; }
  .brand strong { font-size: 15px; }
  .brand small { display: none; }
  .hero { padding: 15px 11px; }
  .heroMain { min-height: 230px; padding: 29px 24px; }
  .hero h1 { font-size: clamp(36px, 11vw, 46px); }
  .contact { padding: 24px; }
  .wrap { padding: 0 11px 29px; }
  .formgrid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .day { min-height: 77px; padding: 5px; }
  .event { font-size: 8px; padding: 5px 4px; }
  .legend { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
