#webirus-home-calendar-host {
  position: fixed;
  z-index: 30;
  display: none;
  min-width: 0;
  padding: 16px 24px 24px;
  box-sizing: border-box;
  overflow: auto;
  background: Canvas;
}

body[data-webirus-home-calendar-active="true"] #webirus-home-calendar-host {
  display: block;
}

.webirus-home-calendar {
  --whc-border: color-mix(in srgb, currentColor 12%, transparent);
  --whc-border-strong: color-mix(in srgb, currentColor 20%, transparent);
  --whc-surface: color-mix(in srgb, Canvas 96%, currentColor 4%);
  --whc-surface-muted: color-mix(in srgb, Canvas 90%, currentColor 10%);
  --whc-text: color-mix(in srgb, currentColor 92%, transparent);
  --whc-text-muted: color-mix(in srgb, currentColor 58%, transparent);
  --whc-accent: #2563eb;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 172px);
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  color: var(--whc-text);
  border: 1px solid var(--whc-border);
  border-radius: 8px;
  background: var(--whc-surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  overflow: hidden;
}

html[data-theme*="dark"] .webirus-home-calendar {
  --whc-surface: color-mix(in srgb, Canvas 84%, white 3%);
  --whc-surface-muted: color-mix(in srgb, Canvas 78%, white 7%);
  --whc-accent: #60a5fa;
  box-shadow: none;
}

.whc-header,
.whc-month-row,
.whc-weekdays {
  display: flex;
  align-items: center;
}

.whc-header {
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--whc-border);
}

.whc-title-block {
  min-width: 0;
}

.whc-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.whc-title-row h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: 0;
}

.whc-title-block p,
.whc-status,
.whc-month-row span {
  color: var(--whc-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.whc-title-block p {
  margin: 2px 0 0;
}

.whc-count {
  flex: 0 0 auto;
  border: 1px solid var(--whc-border);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--whc-text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.whc-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.whc-controls button {
  height: 30px;
  border: 1px solid var(--whc-border);
  border-radius: 6px;
  background: Canvas;
  color: inherit;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.whc-controls button:hover {
  border-color: var(--whc-border-strong);
  background: var(--whc-surface-muted);
}

.whc-icon-button {
  width: 30px;
  font-size: 18px !important;
}

.whc-today-button,
.whc-refresh-button {
  padding: 0 10px;
}

.whc-month-row {
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
}

.whc-month-row strong {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
}

.whc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--whc-border);
  border-bottom: 1px solid var(--whc-border);
  background: var(--whc-surface-muted);
}

.whc-weekdays span {
  padding: 7px 10px;
  color: var(--whc-text-muted);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  text-align: left;
}

.whc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(112px, 1fr);
  flex: 1 1 auto;
}

.whc-day {
  min-height: 118px;
  padding: 8px;
  border-right: 1px solid var(--whc-border);
  border-bottom: 1px solid var(--whc-border);
  background: Canvas;
}

.whc-day:nth-child(7n) {
  border-right: 0;
}

.whc-day-muted {
  background: color-mix(in srgb, Canvas 88%, currentColor 4%);
}

.whc-day-today {
  box-shadow: inset 0 0 0 1px var(--whc-accent);
}

.whc-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 6px;
}

.whc-day-number {
  color: var(--whc-text);
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
}

.whc-day-muted .whc-day-number {
  color: var(--whc-text-muted);
}

.whc-day-badge {
  color: var(--whc-accent);
  font-size: 10px;
  line-height: 1;
  font-weight: 650;
}

.whc-issue {
  display: block;
  min-width: 0;
  margin-top: 4px;
  padding: 5px 6px 5px 8px;
  border-left: 3px solid var(--whc-project-color, var(--whc-accent));
  border-radius: 6px;
  background: color-mix(in srgb, var(--whc-project-color, var(--whc-accent)) 9%, Canvas 91%);
  color: inherit;
  text-decoration: none;
}

.whc-issue:hover {
  background: color-mix(in srgb, var(--whc-project-color, var(--whc-accent)) 14%, Canvas 86%);
}

.whc-issue-key,
.whc-issue-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whc-issue-key {
  color: var(--whc-text-muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 650;
}

.whc-issue-name {
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 500;
}

.whc-more {
  margin-top: 5px;
  color: var(--whc-text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.whc-status {
  padding: 9px 16px 12px;
}

.whc-loading .whc-grid {
  opacity: 0.55;
}

@media (max-width: 900px) {
  #webirus-home-calendar-host {
    padding: 10px;
  }

  .webirus-home-calendar {
    width: 100%;
    min-height: calc(100vh - 132px);
  }

  .whc-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .whc-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .whc-refresh-button {
    margin-left: auto;
  }

  .whc-weekdays,
  .whc-grid {
    min-width: 760px;
  }

  .webirus-home-calendar {
    overflow-x: auto;
  }
}
