/* Schedule density — dark theme for tt-generator */

#view-schedule {
  padding: 0 0 32px;
}

.schedule-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.schedule-workspace__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.schedule-tz-field {
  display: grid;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.schedule-tz-field > span {
  padding-left: 2px;
}

.schedule-tz-select,
.density-widget__tz-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 156px;
  height: 38px;
  padding: 0 38px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background-color: var(--input-bg, #12141a);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.5 1.75L7 7.25L12.5 1.75' stroke='%239aa3b2' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  color: var(--text, #e8eaef);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.schedule-tz-select:hover,
.density-widget__tz-select:hover {
  border-color: color-mix(in srgb, var(--text, #e8eaef) 28%, var(--border, rgba(255, 255, 255, 0.1)));
  background-color: color-mix(in srgb, var(--input-bg, #12141a) 88%, #fff);
}

.schedule-tz-select:focus,
.density-widget__tz-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #5b8cff) 55%, var(--border, rgba(255, 255, 255, 0.1)));
  box-shadow: 0 0 0 3px var(--accent-dim, color-mix(in srgb, var(--accent, #5b8cff) 20%, transparent));
}

.schedule-tz-select option,
.density-widget__tz-select option {
  color: #e8eaef;
  background: #161922;
  font-weight: 500;
}

.schedule-tz-banner {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.schedule-range {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.schedule-range__btn.is-active {
  background: rgba(91, 140, 255, 0.22) !important;
  color: #fff !important;
  border-color: transparent;
}

.schedule-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.schedule-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  padding: 14px 16px;
}

.schedule-stat__label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.schedule-stat__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.schedule-stat__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.schedule-stat--busy .schedule-stat__value {
  color: #fb923c;
}

.schedule-stat--empty .schedule-stat__value {
  color: #4ade80;
}

.schedule-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.schedule-chip {
  appearance: none;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.schedule-chip:hover {
  border-color: rgba(91, 140, 255, 0.35);
}

.schedule-chip.is-active {
  background: rgba(91, 140, 255, 0.2);
  border-color: rgba(91, 140, 255, 0.45);
  color: #fff;
}

.schedule-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  padding: 16px;
}

.schedule-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--muted);
}

.schedule-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.schedule-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.schedule-swatch--0 { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.schedule-swatch--1 { background: #166534; }
.schedule-swatch--2 { background: #b45309; }
.schedule-swatch--3 { background: #b91c1c; }

.schedule-heatmap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-heat-table {
  display: grid;
  grid-template-columns: minmax(88px, 110px) repeat(24, minmax(18px, 1fr));
  gap: 3px;
  min-width: 640px;
}

.schedule-heat-table--compact {
  min-width: 520px;
  grid-template-columns: minmax(72px, 96px) repeat(24, minmax(14px, 1fr));
  gap: 2px;
}

.schedule-heat-corner,
.schedule-heat-hour,
.schedule-heat-day {
  font-size: 0.65rem;
  color: var(--muted);
}

.schedule-heat-day {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding-right: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

.schedule-heat-day small {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.62rem;
}

.schedule-heat-day.is-today {
  color: #93c5fd;
}

.schedule-heat-cell {
  appearance: none;
  border: 0;
  border-radius: 4px;
  min-height: 22px;
  padding: 0;
  font-size: 0.58rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  color: transparent;
  cursor: pointer;
  transition: transform 0.1s ease, outline 0.1s ease;
}

.schedule-heat-table--compact .schedule-heat-cell {
  min-height: 16px;
}

.schedule-heat-cell:hover {
  transform: scale(1.08);
  z-index: 1;
}

.schedule-heat-cell.is-selected {
  outline: 2px solid rgba(147, 197, 253, 0.85);
  outline-offset: 1px;
}

.schedule-heat-cell[data-level="1"] { background: #166534; color: #bbf7d0; }
.schedule-heat-cell[data-level="2"] { background: #b45309; color: #ffedd5; }
.schedule-heat-cell[data-level="3"] { background: #b91c1c; color: #fff; }

.schedule-heat-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
}

.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
}

.schedule-event {
  display: grid;
  grid-template-columns: 56px 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-event__time {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.schedule-event__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: #777;
}

.schedule-event[data-channel="posting"] .schedule-event__dot { background: #fe2c55; }
.schedule-event[data-channel="warmup"] .schedule-event__dot { background: #60a5fa; }
.schedule-event[data-kind="done"] .schedule-event__dot { background: #22c55e; }
.schedule-event[data-kind="failed"] .schedule-event__dot { background: #ef4444; }
.schedule-event[data-kind="pending"] .schedule-event__dot { background: #eab308; }

.schedule-event__body strong {
  display: block;
  font-size: 0.92rem;
}

.schedule-event__meta {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.schedule-event__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.schedule-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.schedule-tag--posting { background: rgba(254, 44, 85, 0.18); color: #fb7185; }
.schedule-tag--warmup { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
.schedule-tag--done { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.schedule-tag--failed { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.schedule-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Compact embed in editors */
.density-widget {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.density-widget--embed {
  margin-top: 12px;
}

.density-widget__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.density-widget__title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.density-widget__sub {
  margin: 3px 0 0;
  font-size: 0.75rem;
}

.density-widget__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.density-widget__tz-select {
  min-width: 140px;
  height: 34px;
  font-size: 0.82rem;
  padding: 0 34px 0 10px;
  background-position: right 10px center;
  background-size: 11px 7px;
}

.density-widget__hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.density-widget .schedule-heat-table--compact {
  min-width: 480px;
}

@media (max-width: 720px) {
  .schedule-heat-table {
    min-width: 560px;
  }
}
