.workbench-date-anchor {
  display: inline-flex;
}

.composer-icon-button.active {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.42);
  background: var(--workbench-primary-soft);
  color: var(--workbench-primary-active);
  box-shadow: 0 6px 14px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.12);
}

.workbench-date-chip-row {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.workbench-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.3);
  border-radius: 4px;
  background: var(--workbench-primary-soft);
  color: var(--workbench-primary-active);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.workbench-date-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-date-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: inherit;
}

.workbench-date-chip button:hover {
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.12);
}

.workbench-date-chip button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.composer-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 18px;
  z-index: 120;
  width: min(320px, calc(100% - 36px));
  max-width: calc(100vw - 32px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--workbench-line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
}

.composer-date-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border-radius: 4px;
  background: #f1f5f9;
}

.composer-date-mode-btn {
  min-height: 34px;
  border-radius: 4px;
  color: var(--workbench-muted);
  font-size: 12px;
  font-weight: 800;
}

.composer-date-mode-btn.active {
  background: #fff;
  color: var(--workbench-ink);
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.16);
}

.composer-date-fields {
  display: grid;
  gap: 8px;
}

.composer-date-fields-range {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
}

.composer-date-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.composer-date-field span {
  color: var(--workbench-muted);
  font-size: 11px;
  font-weight: 800;
}

.composer-date-field input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--workbench-line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--workbench-ink);
  font-size: 12px;
  font-weight: 700;
}

.composer-date-field input:focus {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.46);
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.1);
  outline: none;
}

.composer-date-range-sep {
  align-self: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.composer-date-hint {
  margin: 0;
  color: #dc2626;
  font-size: 11px;
  line-height: 1.5;
}

.composer-date-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.composer-date-cancel-btn,
.composer-date-apply-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.composer-date-cancel-btn {
  border: 1px solid var(--workbench-line-strong);
  background: #fff;
  color: var(--workbench-muted);
}

.composer-date-apply-btn {
  background: var(--workbench-primary-active);
  color: #fff;
}

.composer-date-apply-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .composer-date-popover {
    left: 12px;
    width: calc(100% - 24px);
  }

  .composer-date-fields-range {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer-date-range-sep {
    display: none;
  }
}
