/* Calendar timeline refresh: scoped to the main calendar page. */
.calendar-page{padding-top:30px;}

.calendar-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:0 0 26px;
}
.calendar-hero__intro{display:flex;align-items:center;gap:16px;min-width:0;}
.calendar-hero__icon{
  width:42px;height:42px;position:relative;flex:0 0 auto;
  border:2px solid var(--muted);border-radius:9px;opacity:.85;
}
.calendar-hero__icon::before{
  content:"";position:absolute;left:7px;right:7px;top:10px;height:2px;background:var(--muted);
}
.calendar-hero__icon::after{
  content:"";position:absolute;left:9px;top:-5px;width:4px;height:9px;border-radius:4px;
  background:var(--muted);box-shadow:17px 0 0 var(--muted);
}
.calendar-hero__title{margin:0;font-size:25px;line-height:1.1;letter-spacing:-.02em;}
.calendar-hero__subtitle{margin:6px 0 0;color:var(--muted);font-size:13px;}
.calendar-view-switch{
  display:flex;align-items:center;padding:3px;border:1px solid var(--border);border-radius:14px;
  background:rgba(255,255,255,.58);box-shadow:0 5px 16px rgba(15,23,42,.04);
}
.calendar-view-switch__item{
  padding:9px 15px;border-radius:10px;color:var(--muted);font-size:12px;font-weight:750;white-space:nowrap;
}
.calendar-view-switch__item--active{background:var(--panel-solid);color:var(--primary);box-shadow:0 2px 8px rgba(15,23,42,.06);}

.calendar-timeline{position:relative;display:flex;flex-direction:column;gap:18px;}
.timeline-day{display:grid;grid-template-columns:62px minmax(0,1fr);gap:14px;position:relative;}
.timeline-day__rail{position:relative;display:flex;justify-content:center;}
.timeline-day__rail::after{
  content:"";position:absolute;width:2px;top:56px;bottom:-24px;border-radius:2px;background:rgba(79,70,229,.22);
}
.timeline-day:last-child .timeline-day__rail::after{display:none;}
.timeline-day__marker{
  width:50px;height:50px;border-radius:50%;position:relative;z-index:1;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  border:1px solid rgba(79,70,229,.25);background:#f2f1ff;color:var(--text);
  box-shadow:0 4px 14px rgba(15,23,42,.04);
}
.timeline-day__marker strong{font-size:16px;line-height:1;font-weight:850;}
.timeline-day__marker span{font-size:9px;line-height:1;margin-top:4px;font-weight:850;color:var(--muted);letter-spacing:.03em;}

.timeline-day__card{
  padding:17px;border:1px solid var(--border);border-radius:18px;background:rgba(255,255,255,.72);
  box-shadow:0 5px 18px rgba(15,23,42,.025);
}
.timeline-day__head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 2px 14px;}
.timeline-day__title{font-size:18px;line-height:1.2;margin:0;font-weight:800;letter-spacing:-.01em;}
.timeline-day__date-link:hover{text-decoration:underline;text-underline-offset:4px;}
.timeline-today-badge{
  display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;
  color:#16833b;background:rgba(34,197,94,.12);border:1px solid rgba(34,197,94,.22);
  font-size:10px;font-weight:900;letter-spacing:.04em;
}

.timeline-events{display:flex;flex-direction:column;gap:8px;}
.timeline-event{
  display:grid;grid-template-columns:118px minmax(0,1fr) auto;align-items:center;gap:12px;
  min-height:56px;padding:8px 10px;border:1px solid var(--border);border-radius:14px;background:rgba(255,255,255,.86);
}
.timeline-event__status{
  align-self:stretch;display:flex;align-items:center;gap:9px;padding:0 8px;
  border-radius:10px;font-size:11px;font-weight:850;letter-spacing:.035em;
}
.timeline-event__dot{width:9px;height:9px;border-radius:50%;background:currentColor;flex:0 0 auto;}
.timeline-event__body{
  min-width:0;display:grid;grid-template-columns:58px minmax(90px,130px) minmax(160px,1fr) minmax(120px,.75fr);
  align-items:center;gap:14px;font-size:13px;
}
.timeline-event__body--memo{grid-template-columns:58px minmax(90px,130px) minmax(160px,1fr);}
.timeline-event__time{font-weight:850;font-variant-numeric:tabular-nums;}
.timeline-event__match{font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.timeline-event__description{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.timeline-event__recipients{min-width:0;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.timeline-event__meta{display:flex;align-items:center;gap:10px;justify-content:flex-end;}
.timeline-event__competition{
  display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;border:1px solid var(--border);
  background:rgba(15,23,42,.035);color:var(--muted);font-size:10px;font-weight:800;white-space:nowrap;
}
.timeline-event__more{
  width:32px;height:32px;display:grid;place-items:center;border-radius:9px;color:var(--muted);
  font-size:22px;line-height:1;font-weight:700;
}
.timeline-event__more:hover{background:rgba(15,23,42,.055);color:var(--text);}
.timeline-event--open{border-color:rgba(79,70,229,.15);background:rgba(79,70,229,.025);}
.timeline-event--open .timeline-event__status{color:#5146df;background:rgba(79,70,229,.055);}
.timeline-event--close{border-color:rgba(239,68,68,.15);background:rgba(239,68,68,.022);}
.timeline-event--close .timeline-event__status{color:#dc3434;background:rgba(239,68,68,.05);}
.timeline-event--memo{border-color:rgba(202,138,4,.18);background:rgba(250,204,21,.055);}
.timeline-event--memo .timeline-event__status{color:#a16207;background:rgba(250,204,21,.10);}
.timeline-empty{padding:12px 4px;font-size:13px;}
.calendar-empty{margin-top:0;}

/* Today is intentionally much more prominent than all other days. */
.timeline-day--today .timeline-day__marker{
  width:54px;height:54px;background:linear-gradient(145deg,#2fbd57,#15923d);color:#fff;
  border-color:rgba(22,163,74,.8);box-shadow:0 8px 20px rgba(22,163,74,.25);
}
.timeline-day--today .timeline-day__marker span{color:rgba(255,255,255,.9);}
.timeline-day--today .timeline-day__rail::after{background:rgba(34,197,94,.42);}
.timeline-day--today .timeline-day__card{
  border-color:rgba(34,197,94,.58);
  background:linear-gradient(105deg,rgba(34,197,94,.115),rgba(255,255,255,.76) 72%);
  box-shadow:0 0 0 3px rgba(34,197,94,.075),0 8px 22px rgba(22,163,74,.08);
}
.timeline-day--today .timeline-day__title{color:#147a34;}

@media (prefers-color-scheme: dark){
  .calendar-view-switch{background:rgba(17,24,39,.65);}
  .calendar-view-switch__item--active{background:rgba(255,255,255,.08);}
  .timeline-day__marker{background:#171b39;border-color:rgba(129,140,248,.3);}
  .timeline-day__card{background:rgba(17,24,39,.62);}
  .timeline-event{background:rgba(17,24,39,.72);}
  .timeline-event__competition{background:rgba(255,255,255,.055);}
  .timeline-event--open{background:rgba(79,70,229,.10);}
  .timeline-event--close{background:rgba(239,68,68,.085);}
  .timeline-event--memo{background:rgba(202,138,4,.09);}
  .timeline-day--today .timeline-day__card{
    background:linear-gradient(105deg,rgba(34,197,94,.20),rgba(17,24,39,.68) 75%);
  }
  .timeline-day--today .timeline-day__title{color:#7fe29b;}
}

@media (max-width:900px){
  .calendar-page{padding-top:22px;}
  .calendar-hero{align-items:flex-start;}
  .timeline-event{grid-template-columns:92px minmax(0,1fr) auto;}
  .timeline-event__body{grid-template-columns:52px minmax(75px,110px) minmax(120px,1fr);gap:10px;}
  .timeline-event__recipients{grid-column:2 / -1;}
  .timeline-event__body--memo{grid-template-columns:52px minmax(75px,110px) minmax(120px,1fr);}
}

@media (max-width:680px){
  .calendar-page{padding-top:18px;}
  .calendar-hero{flex-direction:column;margin-bottom:20px;}
  .calendar-view-switch{align-self:stretch;}
  .calendar-view-switch__item{flex:1;text-align:center;}
  .timeline-day{grid-template-columns:42px minmax(0,1fr);gap:9px;}
  .timeline-day__marker{width:40px;height:40px;}
  .timeline-day__marker strong{font-size:14px;}
  .timeline-day__marker span{font-size:8px;}
  .timeline-day--today .timeline-day__marker{width:42px;height:42px;}
  .timeline-day__rail::after{top:44px;bottom:-20px;}
  .timeline-day__card{padding:12px;border-radius:16px;}
  .timeline-day__head{margin-bottom:10px;}
  .timeline-day__title{font-size:16px;}
  .timeline-event{grid-template-columns:1fr auto;gap:7px;padding:9px;}
  .timeline-event__status{grid-column:1 / 2;align-self:auto;justify-self:start;padding:5px 7px;}
  .timeline-event__body{grid-column:1 / -1;grid-row:2;display:grid;grid-template-columns:48px minmax(0,1fr);gap:5px 9px;}
  .timeline-event__body--memo{grid-template-columns:48px minmax(0,1fr);}
  .timeline-event__time{grid-column:1;grid-row:1;}
  .timeline-event__match{grid-column:2;grid-row:1;}
  .timeline-event__description{grid-column:1 / -1;grid-row:2;white-space:normal;}
  .timeline-event__recipients{grid-column:1 / -1;grid-row:3;white-space:normal;}
  .timeline-event__meta{grid-column:2;grid-row:1;align-self:start;}
  .timeline-event__competition{display:none;}
  .timeline-event__more{width:30px;height:30px;}
}
