/* ============================================================
   GWM V2 — calendar.css
   Guild Calendar — month grid + artwork strips
   ============================================================ */

.cal-loading { padding: 40px; text-align: center; color: var(--fg-3); font-size: 13px; }
.cal-loading.err { color: var(--danger, #f66); }

.cal-wrap { padding: 4px 0 24px; }

/* ── header ── */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month {
  font-size: 17px; font-weight: 700; letter-spacing: .02em;
  min-width: 150px; text-align: center;
}
.cal-month span { color: var(--gold, #F2D29B); font-weight: 500; }

/* ── grid ── */
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; min-width: 640px;
}
.cal-dow {
  margin-bottom: 4px; font-size: 11px; font-weight: 700;
  color: var(--fg-3); text-align: center; letter-spacing: .04em;
}
.cal-dow > div { padding: 4px 0; }

.cal-cell {
  min-height: 92px; padding: 5px;
  background: var(--bg-deep, #141414);
  border: 1px solid var(--line-soft, #2a2a2a);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--gold, #F2D29B); }
.cal-cell.today .cal-daynum { color: var(--gold, #F2D29B); font-weight: 800; }
.cal-cell.clickable { cursor: pointer; transition: border-color .12s; }
.cal-cell.clickable:hover { border-color: var(--fg-3); }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--fg-2); line-height: 1; margin-bottom: 1px; }
.cal-more { font-size: 10px; color: var(--fg-3); padding-left: 2px; }

/* ── event strip ── */
.cal-strip {
  position: relative; overflow: hidden;
  border-radius: 5px; min-height: 26px;
  background: color-mix(in srgb, var(--sc, #888) 14%, var(--bg-deep, #141414));
  display: flex; align-items: stretch;
}
.cal-strip-img {
  position: absolute; inset: 0;
  background-size: cover; background-repeat: no-repeat;
  pointer-events: none;
}
.cal-strip-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,10,.78) 0%, rgba(10,10,10,.45) 55%, rgba(10,10,10,.15) 100%);
  pointer-events: none;
}
.cal-strip.glass .cal-strip-scrim {
  backdrop-filter: blur(3px) saturate(1.15);
  -webkit-backdrop-filter: blur(3px) saturate(1.15);
  background: linear-gradient(120deg, rgba(255,255,255,.10) 0%, rgba(10,10,10,.55) 40%, rgba(10,10,10,.35) 100%);
}
.cal-strip-txt {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  gap: 1px; padding: 3px 6px; min-width: 0;
}
.cal-strip-txt b {
  font-size: 10.5px; font-weight: 700; line-height: 1.15;
  color: var(--sc, #ddd);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-strip-txt span {
  font-size: 9.5px; color: var(--fg-2, #bbb); line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-strip.cancelled { opacity: .5; }
.cal-strip.cancelled .cal-strip-txt b,
.cal-strip.cancelled .cal-strip-txt span { text-decoration: line-through; }
.cal-cancel-tag {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  font-size: 9px; font-weight: 800; font-style: normal; color: #f66; z-index: 2;
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
}

/* ── day modal ── */
.cal-day-modal { display: flex; flex-direction: column; gap: 14px; min-width: min(340px, 82vw); }
.cal-day-list { display: flex; flex-direction: column; gap: 8px; }
.cal-day-empty { font-size: 12px; color: var(--fg-3); padding: 8px 0; }
.cal-day-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-day-row .cal-strip { flex: 1; min-height: 34px; }
.cal-day-row .cal-strip-txt b { font-size: 12px; }
.cal-day-row .cal-strip-txt span { font-size: 11px; }
.cal-day-actions { flex: none; display: flex; gap: 6px; }

.cal-paste-bar {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--gold, #F2D29B); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 10px;
}
.cal-paste-lbl {
  font-size: 11px; font-weight: 700; color: var(--gold, #F2D29B);
  display: flex; gap: 6px; align-items: center; white-space: nowrap;
}
.cal-paste-chip { flex: 1; min-width: 0; max-width: 260px; }
.cal-paste-chip .cal-strip { min-height: 30px; }

.cal-day-add {
  border-top: 1px solid var(--line-soft, #2a2a2a);
  padding-top: 12px; display: flex; flex-direction: column; gap: 8px;
}
.cal-day-add-title { font-size: 11px; font-weight: 700; color: var(--fg-2); letter-spacing: .04em; text-transform: uppercase; }
.cal-day-add-hint { font-size: 11px; color: var(--fg-3); margin-top: -2px; }
.cal-day-add-row { display: flex; gap: 8px; }
.cal-day-add-row select { flex: 1.3; min-width: 0; }
.cal-day-add-row input  { flex: 1; min-width: 0; width: auto; }

/* ── settings modal ── */
.cal-settings {
  display: flex; flex-direction: column; gap: 10px;
  min-width: min(430px, 86vw); max-height: 64vh; overflow-y: auto;
  padding-right: 4px;
}
.cal-set-head {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold, #F2D29B);
  border-top: 1px dashed var(--line-soft, #2a2a2a);
  padding-top: 12px; margin-top: 6px;
}
.cal-settings > .cal-set-head:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.cal-set-hint { font-size: 11px; color: var(--fg-3); line-height: 1.5; }

.cal-routine-row {
  border: 1px solid var(--line-soft, #2a2a2a); border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 8px;
}
.cal-rr-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-rr-line .inp { flex: 1; min-width: 90px; }
.rr-lbl { font-size: 11px; color: var(--fg-3); flex: none; }
.rr-day {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--fg-2); cursor: pointer; user-select: none;
}

.cal-type-row {
  border: 1px solid var(--line-soft, #2a2a2a); border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 8px;
}
.cal-tr-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-tr-line .tr-label { flex: 1; min-width: 110px; }
.tr-color {
  width: 34px; height: 30px; padding: 2px; border-radius: 6px;
  border: 1px solid var(--line-soft, #2a2a2a); background: var(--bg-deep, #141414);
  cursor: pointer; flex: none;
}
.tr-file { cursor: pointer; }
.cal-tr-preview { cursor: grab; }
.cal-tr-preview:active { cursor: grabbing; }
.cal-tr-preview .cal-strip { min-height: 44px; }
.cal-tr-preview .cal-strip-txt b { font-size: 13px; }
.cal-tr-preview .cal-strip-txt span { font-size: 11px; }
.tr-op { flex: 1; min-width: 100px; }

/* mobile */
@media (max-width: 700px) {
  .cal-month { min-width: 118px; font-size: 15px; }
  .cal-grid { min-width: 560px; }
  .cal-cell { min-height: 80px; }
}
