




#mw-clock-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}


#mw-cal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;




  width: 40px;
  height: 40px;
  margin: -5px 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--mw-dur) var(--mw-ease);
}


#mw-cal-btn:hover,
#mw-cal-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px currentColor; }
#mw-cal-btn:focus-visible { outline: 2px solid var(--mw-accent); outline-offset: 2px; }



#mw-cal-pop {
  position: absolute;
  z-index: 9000;
  width: 288px;
  max-width: calc(100vw - 20px);
  padding: 12px;
  border: 1px solid var(--warm-line, var(--mw-line));
  border-radius: 14px;
  background: var(--warm-card, var(--mw-paper));
  color: var(--warm-ink, var(--mw-ink));
  box-shadow: 0 12px 32px rgb(0 0 0 / 22%);
  font-size: 13px;
}
#mw-cal-pop[hidden] { display: none; }

#mw-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}
#mw-cal-title {
  flex: 1;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
#mw-cal-title:hover { background: var(--warm-bg, var(--mw-neutral-soft)); }
.mw-cal-nav {
  width: 28px;
  height: 28px;
  border: 1px solid var(--warm-line, var(--mw-line));
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.mw-cal-nav:hover { background: var(--warm-bg, var(--mw-neutral-soft)); }

#mw-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mw-cal-dow {
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--warm-sub, var(--mw-ink-soft));
}


.mw-cal-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.mw-cal-day:hover { background: var(--warm-bg, var(--mw-neutral-soft)); }
.mw-cal-day:focus-visible { outline: 2px solid var(--mw-accent); outline-offset: -2px; }

.mw-cal-day.is-picked { background: var(--mw-accent); color: var(--mw-accent-ink); font-weight: 800; }
.mw-cal-day.is-other { opacity: .3; }

.mw-cal-day.is-sun, .mw-cal-day.is-holiday { color: var(--mw-danger-ink); }
.mw-cal-day.is-sat { color: var(--mw-accent); }
.mw-cal-day.is-holiday { font-weight: 700; }

.mw-cal-day.is-holiday::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.mw-cal-day.is-today {
  outline: 2px solid var(--mw-accent);
  outline-offset: -2px;
  font-weight: 800;
}


#mw-cal-list {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--warm-line, var(--mw-line));
  font-size: 12px;
  line-height: 1.7;
}
#mw-cal-list .mw-cal-hd { color: var(--mw-danger-ink); font-weight: 600; }
#mw-cal-list .mw-cal-none { color: var(--warm-sub, var(--mw-ink-soft)); }


#mw-cal-picked {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
#mw-cal-back {
  padding: 2px 8px;
  border: 1px solid var(--warm-line, var(--mw-line));
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
#mw-cal-back:hover { background: var(--warm-bg, var(--mw-neutral-soft)); }

#mw-cal-defects { max-height: 40vh; overflow-y: auto; }
.mw-cal-def-sum { margin-bottom: 4px; font-weight: 700; }
.mw-cal-def {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  border-top: 1px solid var(--warm-line, var(--mw-line));
}
.mw-cal-def-unit { flex: 0 0 auto; font-weight: 600; }

.mw-cal-def-mid {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--warm-sub, var(--mw-ink-soft));
}
.mw-cal-def-st { flex: 0 0 auto; font-size: 11px; color: var(--warm-sub, var(--mw-ink-soft)); }
#mw-cal-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--warm-sub, var(--mw-ink-soft));
}


@media (max-width: 640px) {
  #mw-cal-pop { width: min(320px, calc(100vw - 20px)); }
}
