.tkc-month,
.tkc-week {
  display: block;
  width: 100%;
}

.tkc-month__toolbar,
.tkc-week__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tkc-month__label,
.tkc-week__label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  flex: 1;
}

.tkc-month__nav,
.tkc-week__nav {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 0.75rem;
  min-width: 42px;
  min-height: 42px;
  cursor: pointer;
  font-size: 1rem;
}

.tkc-month__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tkc-month__weekdays > div {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  padding: 0.35rem 0;
}

.tkc-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.tkc-month__day {
  min-height: 142px;
  padding: 0.55rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.9rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
}

.tkc-month__day--outside {
  background: #f8fafc;
  border-style: dashed;
  border-color: #eef2f7;
  cursor: default;
}

.tkc-month__day.is-today,
.tkc-weekgrid__day.is-today {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.tkc-month__day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tkc-month__day-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
}

.tkc-month__events {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tkc-month__event {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 0.65rem;
  background: #eef2ff;
  color: #312e81;
  padding: 0.44rem 0.5rem 0.48rem;
  border: 1px solid #c7d2fe;
  cursor: pointer;
}

.tkc-month__event:hover,
.tkc-month__event:focus {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.tkc-month__event-time {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.tkc-month__event-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.22;
  color: #111827;
}

.tkc-month__event-session {
  display: block;
  color: #4338ca;
  font-size: 0.68rem;
  margin-top: 0.15rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tkc-month__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.28rem;
}

.tkc-month__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  font-size: 0.64rem;
  line-height: 1.2;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

.tkc-month__badge--price {
  background: #111827;
  color: #ffffff;
}

.tkc-month__badge--tinker_level {
  background: #dbeafe;
  color: #1d4ed8;
}

.tkc-month__badge--age {
  background: #ecfeff;
  color: #155e75;
}

.tkc-month__badge--visibility {
  background: #fef3c7;
  color: #92400e;
}

.tkc-month__more {
  font-size: 0.74rem;
  color: #6b7280;
  padding: 0.15rem 0.1rem 0;
}

.tkc-weekgrid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.tkc-weekgrid__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
}

.tkc-weekgrid__times-head,
.tkc-weekgrid__day-head {
  height: 44px;
}

.tkc-weekgrid__times-head {
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
}

.tkc-weekgrid__times-allday {
  height: 48px;
  display: flex;
  align-items: center;
  color: #6b7280;
  font-size: 0.8rem;
}

.tkc-weekgrid__times-body {
  position: relative;
  height: calc(28px * var(--tkc-slot-count, 29));
}

.tkc-weekgrid__time {
  height: 28px;
  font-size: 0.72rem;
  color: #6b7280;
  display: flex;
  align-items: flex-start;
}

.tkc-weekgrid__day {
  display: grid;
  grid-template-rows: 44px 48px 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow: hidden;
}

.tkc-weekgrid__day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.tkc-weekgrid__day-label { font-weight:700; color:#111827; font-size:0.9rem; }
.tkc-weekgrid__day-count { font-size:0.75rem; color:#6b7280; }

.tkc-weekgrid__allday {
  padding: 0.45rem 0.45rem 0.35rem;
  border-bottom: 1px solid #f3f4f6;
  display: grid;
  gap: 0.35rem;
}

.tkc-weekgrid__allday-item {
  width: 100%;
  text-align: left;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #312e81;
  border-radius: 0.65rem;
  padding: 0.36rem 0.46rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.tkc-weekgrid__tracks {
  position: relative;
  height: calc(28px * var(--tkc-slot-count, 29));
}

.tkc-weekgrid__slot {
  height: 28px;
  border-top: 1px solid #f3f4f6;
}

.tkc-weekgrid__event {
  position: absolute;
  border: 1px solid #c7d2fe;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  border-radius: 0.78rem;
  padding: 0.34rem 0.4rem 0.4rem;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.tkc-weekgrid__event:hover,
.tkc-weekgrid__event:focus {
  background: #f8fafc;
  border-color: #a5b4fc;
}

.tkc-weekgrid__event-time { font-size:0.68rem; font-weight:700; color:#4338ca; margin-bottom:0.16rem; line-height:1.15; }
.tkc-weekgrid__event-title { font-size:0.8rem; font-weight:700; color:#111827; line-height:1.18; }
.tkc-weekgrid__event-session { font-size:0.7rem; color:#475569; margin-top:0.15rem; line-height:1.15; }
.tkc-weekgrid__event .tkc-badges { margin-top:0.26rem; gap:0.22rem; }
.tkc-weekgrid__event .tkc-badge { font-size:0.6rem; padding:0.08rem 0.3rem; }

@media (max-width: 1100px) {
  .tkc-month__grid,
  .tkc-month__weekdays {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tkc-weekgrid {
    grid-template-columns: 1fr;
  }
  .tkc-weekgrid__times {
    display: none;
  }
  .tkc-weekgrid__days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .tkc-month__grid,
  .tkc-month__weekdays,
  .tkc-weekgrid__days {
    grid-template-columns: 1fr;
  }

  .tkc-month__day {
    min-height: auto;
  }
}

/* 0.5.16 visual harmony: align calendar views with the calmer shared palette */
.tkc-month__day,
.tkc-weekgrid__day {
  border-color: var(--tkc-line, #e6e8ef);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.035);
}

.tkc-month__event,
.tkc-weekgrid__allday-item {
  background: var(--tkc-accent-soft, #f3efff);
  border-color: #ded6fb;
  color: var(--tkc-accent-text, #44337a);
}

.tkc-month__event:hover,
.tkc-month__event:focus,
.tkc-weekgrid__allday-item:hover,
.tkc-weekgrid__allday-item:focus {
  background: #eee7ff;
  border-color: #cfc3f5;
}

.tkc-month__event-time,
.tkc-month__event-session,
.tkc-weekgrid__event-time {
  color: var(--tkc-accent-text, #44337a);
}

.tkc-month__badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.tkc-month__badge--price {
  background: var(--tkc-warm-soft, #fff4e6);
  color: var(--tkc-warm-text, #8a4b10);
  border-color: rgba(234, 138, 34, 0.24);
}

.tkc-month__badge--tinker_level {
  background: #eef2ff;
  color: #4338ca;
  border-color: #d8ddff;
}

.tkc-month__badge--age {
  background: #ecfeff;
  color: #155e75;
  border-color: #c8f2f6;
}

.tkc-month__badge--visibility {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.tkc-weekgrid__event {
  border-color: #ded6fb;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(67, 56, 202, 0.07);
}

.tkc-weekgrid__event:hover,
.tkc-weekgrid__event:focus {
  background: #fbfaff;
  border-color: #cfc3f5;
}

.tkc-weekgrid__event .tkc-badge {
  box-shadow: none;
}

/* Week auto-window polish */
.tkc-week__window-note {
  margin: -0.25rem 0 0.85rem;
  color: #64748b;
  font-size: 0.84rem;
}

.tkc-week__empty {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  color: #334155;
}

.tkc-week__empty strong {
  color: #111827;
  font-size: 1rem;
}

.tkc-weekgrid__times-allday {
  min-height: 48px;
  height: auto;
}

.tkc-weekgrid__day {
  grid-template-rows: 44px minmax(48px, auto) 1fr;
}

.tkc-weekgrid.has-no-timed {
  grid-template-columns: 120px 1fr;
}

.tkc-weekgrid.has-no-timed .tkc-weekgrid__day {
  grid-template-rows: 44px minmax(74px, auto);
}

.tkc-weekgrid.has-no-timed .tkc-weekgrid__allday {
  border-bottom: 0;
  min-height: 74px;
}

.tkc-weekgrid__allday.is-empty {
  align-content: center;
}

.tkc-weekgrid__allday-empty {
  color: #cbd5e1;
  font-size: 0.8rem;
}

.tkc-weekgrid__allday-item {
  display: grid;
  gap: 0.08rem;
}

.tkc-weekgrid__allday-item small {
  color: #64748b;
  font-size: 0.68rem;
}

/* 1.2.10.14: event type accents in calendar views */
.tkc-month__event,
.tkc-weekgrid__event,
.tkc-weekgrid__allday-item {
  --tkc-event-accent: var(--tkc-accent, #6b46c1);
  border-left: 4px solid var(--tkc-event-accent, var(--tkc-accent, #6b46c1));
}

.tkc-month__event-time,
.tkc-month__event-session,
.tkc-weekgrid__event-time {
  color: var(--tkc-event-accent, var(--tkc-accent, #6b46c1));
}

.tkc-month__event:hover,
.tkc-month__event:focus,
.tkc-weekgrid__event:hover,
.tkc-weekgrid__event:focus,
.tkc-weekgrid__allday-item:hover,
.tkc-weekgrid__allday-item:focus {
  border-left-color: var(--tkc-event-accent, var(--tkc-accent, #6b46c1));
}

/* 1.2.10.16: search + filter ordering */
.tkc-filterbar__search {
  margin-top: 0.65rem;
}

.tkc-filterbar__search label {
  display: grid;
  gap: 0.25rem;
  max-width: 420px;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 800;
}

.tkc-filterbar__search input[type="search"] {
  width: 100%;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  padding: 0.58rem 0.85rem;
  background: #fff;
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.2;
}

.tkc-filterbar__search input[type="search"]:focus {
  outline: 2px solid rgba(107, 70, 193, 0.18);
  border-color: var(--tkc-accent, #6b46c1);
}


/* 1.2.10.17: guild-only badge emphasis */
.tkc-month__badge--visibility {
  background: #fff7d6 !important;
  border-color: #f3d36b !important;
  color: #7c4a03 !important;
  box-shadow: 0 0 0 1px rgba(217,119,6,.12), 0 0 14px rgba(250,204,21,.24);
}

/* 1.2.10.18: quieter Guild-only accent */
.tkc-month__badge--visibility {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #7c4a03 !important;
  box-shadow: 0 0 0 1px rgba(245,158,11,.08), 0 0 8px rgba(245,158,11,.10) !important;
}

/* 1.2.10.19: quieter Guild-only badge in calendar-specific views */
.tkc-month__badge--visibility {
  background: #fffdf0 !important;
  border-color: #f8e9a6 !important;
  color: #80620d !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.045), 0 0 4px rgba(245, 158, 11, 0.055) !important;
}

/* 1.2.10.27: mobile agenda polish
   Desktop keeps the calendar grid/timeline. Phones switch to readable agenda cards. */
.tkc-month__day-date,
.tkc-weekgrid__mobile-agenda,
.tkc-weekgrid__mobile-empty {
  display: none;
}

@media (max-width: 760px) {
  .tkc-month-wrapper,
  .tkc-week-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .tkc-month,
  .tkc-week {
    min-width: 0;
  }

  .tkc-month__toolbar,
  .tkc-week__toolbar {
    gap: 0.6rem;
    margin-bottom: 0.75rem;
  }

  .tkc-month__label,
  .tkc-week__label {
    font-size: 1rem;
    line-height: 1.2;
  }

  .tkc-month__nav,
  .tkc-week__nav {
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }

  .tkc-month__weekdays {
    display: none;
  }

  .tkc-month__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .tkc-month__day--outside,
  .tkc-month__day.has-no-events:not(.is-today) {
    display: none;
  }

  .tkc-month__day {
    min-height: 0;
    padding: 0.8rem;
    border-radius: 1rem;
  }

  .tkc-month__day-head {
    justify-content: flex-start;
    gap: 0.65rem;
    padding-bottom: 0.15rem;
  }

  .tkc-month__day-number {
    display: inline-grid;
    place-items: center;
    min-width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: var(--tkc-accent-soft, #f3efff);
    color: var(--tkc-accent-text, #44337a);
    font-size: 0.9rem;
  }

  .tkc-month__day-date {
    display: inline-block;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
  }

  .tkc-month__events {
    gap: 0.45rem;
  }

  .tkc-month__event {
    padding: 0.65rem 0.72rem;
    border-radius: 0.85rem;
  }

  .tkc-month__event-title {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    font-size: 0.9rem;
  }

  .tkc-month__event-time,
  .tkc-month__event-session {
    font-size: 0.76rem;
    white-space: normal;
  }

  .tkc-month__badges {
    gap: 0.3rem;
    margin-top: 0.36rem;
  }

  .tkc-month__badge,
  .tkc-badge {
    font-size: 0.68rem;
    line-height: 1.15;
    padding: 0.12rem 0.42rem;
  }

  .tkc-week__window-note {
    display: none;
  }

  .tkc-weekgrid,
  .tkc-weekgrid.has-no-timed {
    display: block;
  }

  .tkc-weekgrid__times,
  .tkc-weekgrid__tracks,
  .tkc-weekgrid__allday {
    display: none !important;
  }

  .tkc-weekgrid__days {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .tkc-weekgrid__day {
    display: block;
    border-radius: 1rem;
    overflow: hidden;
  }

  .tkc-weekgrid__day.has-no-events:not(.is-today) {
    opacity: 0.72;
  }

  .tkc-weekgrid__day-head {
    height: auto;
    min-height: 0;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
  }

  .tkc-weekgrid__day-label {
    font-size: 0.92rem;
  }

  .tkc-weekgrid__day-count {
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    min-width: 1.7rem;
    padding: 0.12rem 0.42rem;
    text-align: center;
    font-weight: 800;
  }

  .tkc-weekgrid__mobile-agenda {
    display: grid;
    gap: 0.45rem;
    padding: 0.65rem;
  }

  .tkc-weekgrid__mobile-empty {
    display: block;
    padding: 0.75rem 0.85rem;
    color: #94a3b8;
    font-size: 0.85rem;
  }

  .tkc-weekgrid__mobile-item {
    display: grid;
    gap: 0.18rem;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.72rem;
    text-align: left;
    border: 1px solid #ded6fb;
    border-left: 4px solid var(--tkc-event-accent, var(--tkc-accent, #6b46c1));
    border-radius: 0.85rem;
    background: var(--tkc-accent-soft, #f3efff);
    color: #111827;
    cursor: pointer;
  }

  .tkc-weekgrid__mobile-item:hover,
  .tkc-weekgrid__mobile-item:focus {
    background: #eee7ff;
    border-color: #cfc3f5;
    outline: none;
  }

  .tkc-weekgrid__mobile-time {
    color: var(--tkc-event-accent, var(--tkc-accent, #6b46c1));
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
  }

  .tkc-weekgrid__mobile-title {
    color: #111827;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.22;
  }

  .tkc-weekgrid__mobile-session {
    color: #475569;
    font-size: 0.76rem;
    line-height: 1.2;
  }
}
