.calendar-day-tasks {
  --calendar-cell-pad:10px;
  display:grid;
  grid-auto-rows:28px;
  min-height:84px;
  gap:0;
  margin-inline:calc(var(--calendar-cell-pad) * -1);
}
.calendar-day-tasks .calendar-item {
  display:flex;
  align-items:center;
  gap:3px;
  width:auto;
  min-width:0;
  height:25px;
  margin:2px var(--calendar-cell-pad) 1px;
  padding:3px 7px;
  border-left:3px solid var(--tone);
  border-radius:6px;
  overflow:hidden;
  position:relative;
  z-index:1;
}
.calendar-lane-placeholder { display:block; min-width:0; min-height:1px; }
.calendar-day-tasks .calendar-item.calendar-connect-left {
  margin-left:0;
  padding-left:6px;
  border-left:0;
  border-top-left-radius:0;
  border-bottom-left-radius:0;
}
.calendar-day-tasks .calendar-item.calendar-connect-right {
  margin-right:0;
  border-top-right-radius:0;
  border-bottom-right-radius:0;
}
.calendar-day-tasks .calendar-item:hover { z-index:2; }
.calendar-day-tasks .calendar-item:focus-visible { z-index:3; }
.calendar-item-context {
  flex:0 1 auto;
  max-width:min(8.5em,46%);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:0 5px;
  border:1px solid #ffffffcc;
  border-radius:999px;
  background:#ffffffad;
  font-size:10px;
  font-weight:700;
  line-height:1.55;
  color:var(--ink);
}
.calendar-item-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.calendar-carry { margin-left:auto; font-size:14px; line-height:1; opacity:.72; }
.calendar-day-tasks .calendar-item.calendar-carry-before { border-left-style:dashed; }
.calendar-day-select time { display:flex; align-items:center; gap:6px; width:auto; padding:0; background:transparent; }
.day.today {
  background:linear-gradient(180deg,#f7f2ff 0,#fff 62%);
  box-shadow:inset 0 0 0 2px #b99bea;
}
.day.today.selected { background:linear-gradient(180deg,#eee5ff 0,#f8f5ff 68%); }
.day.today .calendar-day-select time { width:auto; padding:0; background:transparent; color:#5f35ad; font-weight:700; }
.calendar-today-label {
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:1px 7px;
  border-radius:999px;
  background:#7044bd;
  color:#fff;
  font-size:10px;
  font-weight:700;
  letter-spacing:.04em;
  white-space:nowrap;
}
.calendar.is-expanded .calendar-day-tasks {
  grid-auto-rows:51px;
  min-height:153px;
}
.calendar.is-expanded .calendar-day-tasks .calendar-item {
  align-items:flex-start;
  height:48px;
  padding-top:4px;
}
.calendar.is-expanded .calendar-item-label {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  white-space:normal;
  overflow-wrap:anywhere;
  text-overflow:clip;
  line-height:1.45;
}
@media(max-width:1050px) { .calendar-day-tasks { --calendar-cell-pad:7px; } }
@media(max-width:700px) {
  .calendar-day-tasks { --calendar-cell-pad:4px; grid-auto-rows:25px; min-height:75px; }
  .calendar-day-tasks .calendar-item { height:23px; padding-inline:4px; }
  .calendar-item-context { max-width:6.5em; padding-inline:3px; font-size:9px; }
  .calendar.is-expanded .calendar-day-tasks { grid-auto-rows:46px; min-height:138px; }
  .calendar.is-expanded .calendar-day-tasks .calendar-item { height:43px; padding-top:3px; }
  .calendar-carry { display:none; }
}

.calendar-day-head {
  display:flex;
  align-items:center;
  gap:5px;
  min-height:25px;
}
.calendar-day-head .calendar-day-select { flex:1; width:auto; min-width:0; }
.calendar-day-add {
  flex:0 0 23px;
  width:23px;
  height:23px;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#8975a8;
  font-size:17px;
  line-height:1;
  opacity:.2;
}
.day:hover .calendar-day-add,.calendar-day-add:focus-visible { opacity:1; background:#eee8f8; }
.china-day-badge {
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-width:0;
  color:#8b6a56;
  font-size:10px;
  line-height:1.5;
  white-space:nowrap;
}
.china-day-badge b {
  display:inline-grid;
  place-items:center;
  min-width:21px;
  height:21px;
  padding:0 4px;
  border-radius:6px;
  background:#f0ece8;
  color:#846e60;
  font-size:11px;
}
.china-day-badge span { overflow:hidden; text-overflow:ellipsis; max-width:5.5em; }
.china-day-badge.china-holiday b { background:#ffe2dc; color:#bd5546; }
.china-day-badge.china-adjusted-workday b { background:#fff0c7; color:#986815; }
.china-day-badge.china-weekend b { background:#eef0f4; color:#7e8796; }
.day.china-weekend { background:#fafbfc; }
.day.china-holiday { background:linear-gradient(180deg,#fff7f4 0,#fff 46%); }
.day.china-adjusted-workday { background:linear-gradient(180deg,#fffaf0 0,#fff 46%); }
.day.selected:not(.today) { box-shadow:inset 0 0 0 2px #d4c3ed; }
.day.today { background:linear-gradient(180deg,#f7f2ff 0,#fff 62%); }
.calendar-personal-entries {
  display:flex;
  align-items:center;
  gap:4px;
  height:30px;
  min-width:0;
  margin:2px 0 3px;
}
.calendar-personal-empty { display:block; min-width:1px; }
.calendar-personal-entry {
  display:flex;
  align-items:center;
  gap:4px;
  min-width:0;
  max-width:calc(100% - 29px);
  height:25px;
  padding:3px 7px;
  border:1px solid #e5d9f4;
  border-radius:7px;
  background:#f5effc;
  color:#71499a;
  font-size:10px;
  font-weight:600;
  overflow:hidden;
}
.calendar-personal-entry span,.calendar-personal-entry small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.calendar-personal-entry small { font-weight:500; opacity:.82; }
.calendar-personal-entry.entry-leave { background:#fff0ec; border-color:#f5d2c9; color:#a65343; }
.calendar-personal-entry.entry-business_trip { background:#ebf4ff; border-color:#d1e4f8; color:#376fa0; }
.calendar-personal-entry.entry-training { background:#eaf8f2; border-color:#cceadc; color:#2c7d65; }
.calendar-personal-entry.entry-overtime { background:#fff6dc; border-color:#f0e0ad; color:#8a6818; }
.calendar-personal-entry.entry-personal { background:#f4efff; border-color:#ddd0f5; color:#7652a5; }
.calendar-personal-more { flex:0 0 27px; padding:3px; border:0; background:transparent; color:#7c6a96; font-size:10px; }
.calendar-schedule-hint { display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin:10px 0 6px; }
.calendar-schedule-hint .china-day-badge { margin-left:4px; }
.calendar-schedule-hint a { text-decoration:underline; text-underline-offset:2px; }
.calendar-schedule-missing { color:#9a752e; }
.calendar-record-selection { margin-top:20px; padding:16px 18px; border:1px solid #e5dcef; border-radius:12px; background:#fcfaff; }
.calendar-selection-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.calendar-selection-head h3 { margin-bottom:5px; }
.calendar-selection-head p { display:flex; align-items:center; gap:7px; color:#7c698e; font-size:12px; }
.calendar-record-list { display:grid; gap:8px; margin-top:12px; }
.calendar-record-card { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 13px; border-left:4px solid #9b72c3; border-radius:8px; background:#fff; box-shadow:0 1px 0 #ece6f2; }
.calendar-record-card.entry-leave { border-left-color:#e48069; }
.calendar-record-card.entry-business_trip { border-left-color:#5a9bd3; }
.calendar-record-card.entry-training { border-left-color:#46a889; }
.calendar-record-card.entry-overtime { border-left-color:#d5a83e; }
.calendar-record-card.entry-personal { border-left-color:#9371c0; }
.calendar-record-card strong { font-size:13px; color:#3c485a; }
.calendar-record-card p { margin-top:3px; font-size:13px; color:#596a80; }
.calendar-record-card small { display:block; margin-top:5px; color:#8290a2; white-space:pre-wrap; }
#calendar-entry-editor { width:min(650px,calc(100vw - 32px)); }
.calendar-entry-form { padding:22px 24px 24px; }
.calendar-entry-form .dialog-actions { margin-bottom:0; }
.dialog-action-spacer { flex:1; }
@media(max-width:700px) {
  .china-day-badge span { display:none; }
  .calendar-day-add { flex-basis:18px; width:18px; height:20px; opacity:.65; font-size:15px; }
  .calendar-today-label { min-height:18px; padding-inline:4px; font-size:9px; }
  .calendar-personal-entry small { display:none; }
  .calendar-record-selection { padding:13px; }
  .calendar-selection-head { align-items:stretch; flex-direction:column; }
  .calendar-entry-form { padding:18px; }
}
