:root {
  --ink: #17211f;
  --muted: #6f7c78;
  --line: #dce5e2;
  --soft: #f4f8f7;
  --mint: #0e9f7b;
  --mint-soft: #e5f7f1;
  --blue: #3a6fd8;
  --blue-soft: #eaf1ff;
  --orange: #bf6a20;
  --orange-soft: #fff1df;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: #eef3f1; }
body {
  margin: 0;
  color: var(--ink);
  background: #eef3f1;
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button { font: inherit; }
.page-shell { min-height: 100vh; padding: 24px; }
.topbar, .calendar-section { width: min(1680px, 100%); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #103e36, #14a27f);
  box-shadow: 0 10px 28px rgba(14, 104, 83, .22);
  font-weight: 800;
}
.brand-lockup p, .brand-lockup h1 { margin: 0; }
.brand-lockup p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-lockup h1 { margin-top: 2px; font-size: 21px; letter-spacing: -.035em; }
.source-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid #d9e4e0;
  border-radius: 999px;
  color: #596763;
  background: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 700;
}
.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #19b88e;
  box-shadow: 0 0 0 4px rgba(25,184,142,.13);
}
.calendar-section {
  background: #fff;
  border: 1px solid rgba(213,224,220,.9);
  border-radius: 24px;
  box-shadow: 0 18px 55px rgba(35,63,56,.09);
  overflow: hidden;
}
.calendar-toolbar {
  min-height: 90px;
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.month-navigation { display: flex; align-items: center; gap: 14px; }
.month-navigation button, .drawer-header button { border: 0; cursor: pointer; }
.month-navigation button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #35433f;
  background: var(--soft);
  font-size: 26px;
  transition: background 160ms ease, transform 160ms ease;
}
.month-navigation button:hover { background: #e6efec; transform: translateY(-1px); }
.month-navigation button:focus-visible, .drawer-header button:focus-visible {
  outline: 3px solid rgba(14,159,123,.25);
  outline-offset: 2px;
}
.month-navigation h2 {
  min-width: 160px;
  margin: 0;
  text-align: center;
  font-size: 24px;
  letter-spacing: -.04em;
}
.month-summary { display: flex; align-items: baseline; gap: 9px; color: var(--muted); font-size: 13px; }
.month-summary strong { color: var(--ink); font-size: 21px; }
.legend {
  min-height: 48px;
  padding: 10px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
  color: #62706c;
  font-size: 12px;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.legend p { margin: 0 0 0 auto; }
.legend-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; }
.legend-dot.issue { background: var(--blue); }
.legend-dot.expire { background: var(--orange); }

.calendar-scroll { overflow-x: auto; overflow-y: visible; }
.calendar-grid { min-width: 1120px; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekday {
  padding: 15px 10px;
  text-align: center;
  color: #5f6e69;
  background: #eaf1ef;
  border-right: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
}
.weekday:nth-child(7) { border-right: 0; }
.sunday { color: #e05050 !important; }
.saturday { color: #2f78bd !important; }
.day-cell {
  min-height: 158px;
  padding: 12px 10px 16px;
  position: relative;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.day-cell:nth-child(7n + 7) { border-right: 0; }
.day-cell.outside { background: #fafcfc; }
.day-cell.outside .day-heading > span { color: #acb6b2 !important; }
.day-heading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-heading > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}
.day-heading small {
  padding: 3px 7px;
  border-radius: 999px;
  color: #52615d;
  background: #edf3f1;
  font-size: 10px;
  font-weight: 800;
}
.day-events { margin-top: 8px; display: grid; gap: 7px; }
.event-card {
  width: 100%;
  padding: 10px;
  position: relative;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.event-card.issue { color: #234e8e; background: var(--blue-soft); }
.event-card.expire { color: #8b4d17; background: var(--orange-soft); }
.event-card:hover, .event-card:focus-visible {
  z-index: 20;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(49,69,63,.14);
  outline: none;
}
.event-card.issue:hover, .event-card.issue:focus-visible { border-color: #bfd2f7; }
.event-card.expire:hover, .event-card.expire:focus-visible { border-color: #f0c996; }
.event-tags { display: flex; gap: 5px; }
.event-tags span {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.7);
  font-size: 9px;
  font-weight: 800;
}
.event-card strong, .event-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-card strong { margin-top: 6px; font-size: 12px; line-height: 1.4; }
.event-card small { margin-top: 3px; opacity: .82; font-size: 10px; }
.event-tooltip {
  width: 310px;
  padding: 16px;
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  z-index: 50;
  transform: translateX(-50%);
  color: #27332f;
  background: #fff;
  border: 1px solid #dfe7e4;
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(28,50,44,.2);
  cursor: default;
}
.event-tooltip::before {
  content: "";
  width: 12px;
  height: 12px;
  position: absolute;
  left: calc(50% - 6px);
  top: -7px;
  transform: rotate(45deg);
  background: #fff;
  border-left: 1px solid #dfe7e4;
  border-top: 1px solid #dfe7e4;
}
.event-card:hover .event-tooltip, .event-card:focus-visible .event-tooltip { display: grid; gap: 8px; }
.event-tooltip b {
  margin-bottom: 5px;
  padding-bottom: 11px;
  border-bottom: 1px solid #edf1f0;
  font-size: 13px;
  line-height: 1.45;
}
.event-tooltip > span {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
  font-size: 11px;
  line-height: 1.4;
}
.event-tooltip em { color: #89938f; font-style: normal; font-weight: 700; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  opacity: 0;
  background: rgba(16,26,23,.52);
  backdrop-filter: blur(2px);
  transition: opacity 220ms ease, visibility 220ms ease;
}
.drawer-backdrop.open { visibility: visible; opacity: 1; }
.detail-drawer {
  width: min(540px, 100vw);
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 90;
  transform: translateX(102%);
  background: #fff;
  box-shadow: -24px 0 60px rgba(18,37,31,.2);
  transition: transform 250ms cubic-bezier(.2,.75,.2,1);
}
.detail-drawer.open { transform: translateX(0); }
.drawer-header {
  min-height: 140px;
  padding: 28px 30px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-header p, .drawer-header h2 { margin: 0; }
.drawer-header p {
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.drawer-header h2 { margin-top: 9px; font-size: 23px; line-height: 1.35; letter-spacing: -.035em; }
.drawer-header button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #53605c;
  background: var(--soft);
  font-size: 25px;
}
.drawer-content { height: calc(100vh - 140px); padding: 24px 30px 44px; overflow-y: auto; }
.drawer-date {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 14px;
  color: #24584b;
  background: var(--mint-soft);
  font-size: 13px;
}
.detail-list { margin: 24px 0 0; }
.detail-list > div {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  border-bottom: 1px solid #edf1f0;
}
.detail-list dt { color: #8a9692; font-size: 12px; font-weight: 800; }
.detail-list dd { margin: 0; color: #2f3b37; font-size: 13px; font-weight: 650; line-height: 1.55; }
.long-detail { margin-top: 28px; }
.long-detail h3 { margin: 0 0 12px; font-size: 15px; }
.long-detail p {
  margin: 0;
  padding: 18px;
  border: 1px solid #e6ecea;
  border-radius: 14px;
  color: #4e5d58;
  background: #f8faf9;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.copy-block p { color: #694619; border-color: #f3dfbe; background: #fff8eb; }

@media (max-width: 720px) {
  .page-shell { padding: 14px; }
  .topbar { align-items: flex-start; }
  .source-note { max-width: 150px; border-radius: 14px; line-height: 1.35; }
  .calendar-section { border-radius: 18px; }
  .calendar-toolbar { padding: 18px; }
  .month-navigation { gap: 7px; }
  .month-navigation h2 { min-width: 125px; font-size: 20px; }
  .month-summary span { display: none; }
  .legend { padding-inline: 18px; }
  .legend p { display: none; }
  .drawer-header, .drawer-content { padding-inline: 22px; }
}

@media (hover: none) {
  .event-tooltip { display: none !important; }
}

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