/* calendar.css — views (schedule, month, week, day), chips, mini cal, sheets. */

/* ---------- Sub-header (date nav inside main) ---------- */
.wc-subhead {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-bottom: 1px solid var(--wc-line-soft);
  flex: 0 0 auto;
}
.wc-subhead__label { font-size: 15px; font-weight: 500; color: var(--wc-text-strong); padding: 0 6px; }
.wc-subhead .wc-btn { height: 36px; }

.wc-viewport {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  position: relative;
}

/* ---------- Loading / empty states ---------- */
.wc-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--wc-text-muted); height: 100%; padding: 40px; gap: 12px;
}
.wc-state .material-symbols-rounded { font-size: 48px; color: var(--wc-text-faint); }
.wc-state h3 { margin: 0; font-size: 18px; color: var(--wc-text-strong); font-weight: 500; }
.wc-state p { margin: 0; font-size: 14px; max-width: 320px; }
.wc-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--wc-line); border-top-color: var(--wc-accent);
  animation: wc-spin .8s linear infinite;
}
@keyframes wc-spin { to { transform: rotate(360deg); } }

/* ---------- Chips ---------- */
.wc-chip {
  display: flex; align-items: center; gap: 6px;
  border-radius: var(--wc-chip-radius); padding: 3px 8px;
  font-size: 12px; line-height: 1.3; cursor: pointer;
  background: var(--wc-chip-bg, var(--wc-accent));
  color: #fff; overflow: hidden; min-height: 22px; min-width: 0;
}
.wc-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.9); flex: 0 0 auto; }
.wc-chip__time { font-weight: 600; opacity: .92; flex: 0 0 auto; }
.wc-chip__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Schedule / Agenda ---------- */
.wc-schedule { padding: 0 0 calc(96px + env(safe-area-inset-bottom, 0px)); }
.wc-sch-month {
  position: sticky; top: 0; z-index: 4;
  font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--wc-text-muted); background: var(--wc-bg);
  padding: 14px 16px 8px; border-bottom: 1px solid var(--wc-line-soft);
}
.wc-sch-item__cat { font-weight: 600; }
.wc-sch-day { display: flex; gap: 16px; padding: 10px 16px; align-items: flex-start; }
.wc-sch-day + .wc-sch-day { border-top: 1px solid var(--wc-line-soft); }
.wc-sch-date {
  flex: 0 0 52px; text-align: center; padding-top: 4px;
}
.wc-sch-date .dow { font-size: 11px; text-transform: uppercase; color: var(--wc-text-muted); letter-spacing: .4px; }
.wc-sch-date .dnum {
  font-size: 24px; font-weight: 500; color: var(--wc-text-strong); line-height: 1.1;
}
.wc-sch-date.is-today .dnum {
  background: var(--wc-today); color: var(--wc-today-fg);
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; margin: 0 auto;
}
.wc-sch-date .mon { font-size: 11px; color: var(--wc-text-faint); }
.wc-sch-items { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wc-sch-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px;
  cursor: pointer; min-height: 44px;
}
.wc-sch-item:hover { background: var(--wc-surface-hover); }
.wc-sch-item__bar { width: 6px; align-self: stretch; border-radius: 4px; flex: 0 0 auto; min-height: 28px; }
.wc-sch-item__body { min-width: 0; flex: 1 1 auto; }
.wc-sch-item__title { font-size: 15px; color: var(--wc-text-strong); font-weight: 500; }
.wc-sch-item__meta { font-size: 12.5px; color: var(--wc-text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Month grid ---------- */
.wc-month { display: flex; flex-direction: column; height: 100%; }
.wc-month__dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--wc-line-soft); flex: 0 0 auto;
}
.wc-month__dow span {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--wc-text-muted);
  text-transform: uppercase; padding: 8px 0; letter-spacing: .4px;
}
.wc-month__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr; flex: 1 1 auto; min-height: 0;
}
.wc-mcell {
  border-right: 1px solid var(--wc-line-soft); border-bottom: 1px solid var(--wc-line-soft);
  padding: 2px 4px; overflow: hidden; cursor: pointer; min-height: 84px;
  display: flex; flex-direction: column;
}
.wc-mcell:nth-child(7n) { border-right: none; }
.wc-mcell.is-other { background: var(--wc-surface-2); }
.wc-mcell.is-other .wc-mcell__num { color: var(--wc-text-faint); }
.wc-mcell:hover { background: var(--wc-surface-hover); }
.wc-mcell__num {
  font-size: 12px; font-weight: 600; color: var(--wc-text); text-align: center;
  width: 24px; height: 24px; line-height: 24px; border-radius: 50%; margin: 2px auto 2px;
}
.wc-mcell.is-today .wc-mcell__num { background: var(--wc-today); color: var(--wc-today-fg); }
.wc-mcell__chips { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.wc-mcell__more { font-size: 11px; color: var(--wc-text-muted); padding: 1px 6px; font-weight: 500; }

/* Phone month = dots. Whole cell is the tap target; number bigger for tapping. */
.wc-month--dots .wc-mcell { min-height: 58px; padding: 4px 2px; align-items: center; }
.wc-month--dots .wc-mcell__num {
  font-size: 14px; width: 30px; height: 30px; line-height: 30px; margin: 2px auto 3px;
}
.wc-mcell__dots {
  display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center;
  gap: 3px; width: 100%; min-height: 8px;
}
.wc-mcell__dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.wc-mcell__dotmore { font-size: 9px; line-height: 6px; color: var(--wc-text-muted); font-weight: 600; }

/* ---------- Time grid (week + day) ---------- */
.wc-timegrid { display: flex; flex-direction: column; min-height: 0; }
.wc-tg-allday {
  display: grid; border-bottom: 1px solid var(--wc-line); flex: 0 0 auto;
}
.wc-tg-allday__label {
  font-size: 10px; color: var(--wc-text-muted); text-transform: uppercase;
  display: flex; align-items: center; justify-content: flex-end; padding: 4px 6px;
}
.wc-tg-allday__col { border-left: 1px solid var(--wc-line-soft); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 28px; }

.wc-tg-head { display: grid; border-bottom: 1px solid var(--wc-line-soft); flex: 0 0 auto; position: sticky; top: 0; background: var(--wc-bg); z-index: 5; }
.wc-tg-head__gut {}
.wc-tg-head__day { text-align: center; padding: 6px 2px; border-left: 1px solid var(--wc-line-soft); }
.wc-tg-head__day .dow { font-size: 12px; text-transform: uppercase; color: var(--wc-text-muted); letter-spacing: .3px; }
.wc-tg-head__day .dnum { font-size: 22px; font-weight: 500; color: var(--wc-text-strong); }
.wc-tg-head__day.is-today .dnum {
  background: var(--wc-today); color: var(--wc-today-fg);
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}

.wc-tg-body { display: grid; position: relative; flex: 1 1 auto; }
.wc-tg-gutter { position: relative; }
.wc-tg-hour { height: 48px; position: relative; }
.wc-tg-gutter .wc-tg-hour span {
  position: absolute; top: -7px; right: 6px; font-size: 12px; color: var(--wc-text-faint);
}
.wc-tg-col { position: relative; border-left: 1px solid var(--wc-line-soft); }
.wc-tg-col .wc-tg-hour { border-top: 1px solid var(--wc-line-soft); }
.wc-tg-event {
  position: absolute; left: 2px; right: 2px; border-radius: 6px; padding: 3px 6px;
  color: #fff; font-size: 12.5px; overflow: hidden; cursor: pointer; box-shadow: var(--wc-sh-1);
  min-height: 18px;
}
.wc-tg-event .t { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-tg-event .s { opacity: .9; font-size: 11.5px; }
.wc-tg-now {
  position: absolute; left: 0; right: 0; height: 2px; background: #ea4335; z-index: 6;
}
.wc-tg-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ea4335; }

/* ---------- Mini calendar (drawer) ---------- */
.wc-minical { padding: 8px 6px 10px; border-bottom: 1px solid var(--wc-line-soft); }
.wc-minical__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 6px; }
.wc-minical__title { font-size: 14px; font-weight: 600; color: var(--wc-text-strong); }
.wc-minical__nav { display: flex; gap: 2px; }
.wc-minical__nav .wc-iconbtn { width: 40px; height: 40px; }
.wc-minical__nav .material-symbols-rounded { font-size: 20px; }
.wc-minical__grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.wc-minical__dow { font-size: 12px; color: var(--wc-text-faint); text-align: center; padding: 3px 0; }
.wc-mini-day {
  aspect-ratio: 1; border: none; background: transparent; cursor: pointer;
  font-size: 12px; color: var(--wc-text); border-radius: 50%; display: grid; place-items: center;
}
.wc-mini-day:hover { background: var(--wc-surface-hover); }
.wc-mini-day.is-other { color: var(--wc-text-faint); }
.wc-mini-day.is-today { color: var(--wc-accent); font-weight: 700; }
.wc-mini-day.is-selected { background: var(--wc-accent); color: #fff; }
.wc-mini-day.has-events::after {
  content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; transform: translateY(11px); opacity: .6;
}
.wc-mini-day { position: relative; }

/* ---------- My calendars (segments + categories) ---------- */
.wc-cal-section { padding: 4px 6px 12px; }
.wc-cal-section__title {
  font-size: 13px; font-weight: 600; color: var(--wc-text-muted);
  padding: 8px 8px 2px; letter-spacing: .2px;
}
.wc-filterbox {
  display: flex; align-items: center; gap: 8px; margin: 6px 8px 4px;
  background: var(--wc-surface-2); border-radius: 999px; height: 38px; padding: 0 12px;
}
.wc-filterbox .material-symbols-rounded { font-size: 18px; color: var(--wc-text-muted); }
.wc-filterbox input { border: none; background: transparent; outline: none; width: 100%; color: var(--wc-text); font-size: 13px; }

.wc-seg { margin-top: 6px; }
.wc-seg__head {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer;
  border-radius: 8px;
}
.wc-seg__head:hover { background: var(--wc-surface-hover); }
.wc-seg__swatch { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; }
.wc-seg__caret { font-size: 20px; color: var(--wc-text-muted); transition: transform .15s ease; flex: 0 0 auto; }
.wc-seg.collapsed .wc-seg__caret { transform: rotate(-90deg); }
.wc-seg__name { font-size: 13px; font-weight: 600; color: var(--wc-text-strong); flex: 1 1 auto; }
.wc-seg__count { font-size: 11px; color: var(--wc-text-faint); }
.wc-seg__actions { display: flex; gap: 8px; padding: 2px 8px 6px 30px; }
.wc-seg__pill {
  border: 1px solid var(--wc-line); background: var(--wc-surface); color: var(--wc-accent);
  font-size: 12px; cursor: pointer; min-height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 600;
}
.wc-seg__pill:hover { background: var(--wc-accent-weak); }
.wc-seg__pill:active { background: var(--wc-accent-weak); }
.wc-seg.collapsed .wc-seg__list, .wc-seg.collapsed .wc-seg__actions { display: none; }

.wc-cal-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 30px;
  cursor: pointer; border-radius: 8px; min-height: 44px;
}
.wc-cal-item:hover { background: var(--wc-surface-hover); }
.wc-cal-box {
  width: 18px; height: 18px; border-radius: 4px; flex: 0 0 auto;
  border: 2px solid var(--wc-cb, #888); display: grid; place-items: center; transition: background .12s;
}
.wc-cal-box .material-symbols-rounded { font-size: 16px; color: #fff; opacity: 0; }
.wc-cal-item.on .wc-cal-box { background: var(--wc-cb); }
.wc-cal-item.on .wc-cal-box .material-symbols-rounded { opacity: 1; }
.wc-cal-name { font-size: 13.5px; color: var(--wc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-cal-item:not(.on) .wc-cal-name { color: var(--wc-text-muted); }

/* ---------- Event detail sheet/popover ---------- */
.wc-sheet-scrim {
  position: fixed; inset: 0; background: var(--wc-overlay);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 60;
}
.wc-sheet-scrim.open { opacity: 1; pointer-events: auto; }
.wc-sheet {
  position: fixed; z-index: 61; background: var(--wc-surface);
  box-shadow: var(--wc-sh-3); border-radius: var(--wc-radius-lg);
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-height: 85vh; overflow-y: auto;
  transition: transform .26s cubic-bezier(.16,1,.3,1), opacity .18s ease;
}
/* desktop: centered popover-ish */
.wc-sheet { left: 50%; top: 80px; transform: translateX(-50%) translateY(8px); opacity: 0; pointer-events: none; }
.wc-sheet.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
@media (max-width: 840px) {
  .wc-sheet {
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100vw; max-width: 100vw;
    border-radius: 22px 22px 0 0; transform: translateY(100%); opacity: 1;
    max-height: 90vh;
    /* clear the home bar; the bar/header give the drag affordance */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .wc-sheet.open { transform: translateY(0); }
}
.wc-sheet__bar { display: none; }
@media (max-width: 840px) {
  .wc-sheet__bar {
    display: block; width: 40px; height: 5px; border-radius: 5px;
    background: var(--wc-line); margin: 10px auto 2px; cursor: grab;
  }
  .wc-sheet__head { cursor: grab; touch-action: none; }
}
.wc-sheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 4px; }
.wc-sheet__color { width: 16px; height: 16px; border-radius: 4px; margin-top: 5px; flex: 0 0 auto; }
.wc-sheet__title { font-size: 20px; font-weight: 500; color: var(--wc-text-strong); flex: 1 1 auto; min-width: 0; }
.wc-sheet__close { margin: 4px 4px 0 0; }
.wc-sheet__body { padding: 4px 18px 18px; }
.wc-sheet__row { display: flex; align-items: flex-start; gap: 14px; padding: 8px 0; color: var(--wc-text); font-size: 14px; }
.wc-sheet__row .material-symbols-rounded { font-size: 20px; color: var(--wc-text-muted); flex: 0 0 auto; }
.wc-sheet__row a { color: var(--wc-accent); text-decoration: none; word-break: break-all; }
.wc-sheet__cat { display: inline-flex; align-items: center; gap: 8px; }
.wc-sheet__cat .dot { width: 10px; height: 10px; border-radius: 50%; }
.wc-sheet__actions { display: flex; gap: 8px; padding: 4px 16px 18px; }
.wc-sheet__actions .wc-btn.primary { background: var(--wc-accent); color: #fff; border-color: var(--wc-accent); }

/* ---------- Create sheet ---------- */
.wc-form { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.wc-form label { font-size: 12px; color: var(--wc-text-muted); display: block; margin-bottom: 4px; font-weight: 500; }
.wc-form input, .wc-form select, .wc-form textarea {
  width: 100%; border: 1px solid var(--wc-line); background: var(--wc-surface);
  color: var(--wc-text); border-radius: 10px; padding: 11px 12px; font-size: 15px; font-family: inherit;
}
.wc-form input:focus, .wc-form select:focus, .wc-form textarea:focus { outline: 2px solid var(--wc-accent-weak); border-color: var(--wc-accent); }
.wc-form .row2 { display: flex; gap: 12px; }
.wc-form .row2 > div { flex: 1 1 0; min-width: 0; }
.wc-form__title-input { font-size: 18px !important; font-weight: 500; border: none !important; border-bottom: 1px solid var(--wc-line) !important; border-radius: 0 !important; padding-left: 0 !important; }
